t.co Posting Questions

68 views
Skip to first unread message

David E. Wheeler

unread,
Dec 17, 2010, 7:19:17 PM12/17/10
to twitter-deve...@googlegroups.com
Howdy,

I'm writing an iPad app that has a "Share via Twitter" feature. I'm trying to understand how to count characters, including URLs before I post to the API. I thought these might be FAQs, but "t.co" does not show up in the FAQ and has only two hits via Google's search of this list, so I apologize if these are in fact FAQs.

So I tried to post a new status message that was longer than 140 characters, but I counted the URL as only 19 characters, per [this message][] from Raffi. Unfortunately, the API rejected the message as too long. So my questions are:

* Should I be counting URLs as only 19 characters?

* If so, will the Twitter API be adjusted to count URLs as only 19 characters, and not reject messages that are longer because the URLs are longer?

* And if that's the plan, when is it likely to happen?

* And should I also count URLs that are less than 19 characters as 19 characters, on the assumption that they will *always* be wrapped?

Ah, I just did a search for "link wrap" and say [this thread][] from September. Doesn't look like there was an official answer from Twitter -- did I miss it? If not, does anyone have any idea when there might be more information on this stuff and how it will affect the API?

Thanks,

David

[this message]: http://groups.google.com/group/twitter-development-talk/msg/9bdd19b025fe0cba?
[this thread]: http://groups.google.com/group/twitter-development-talk/browse_thread/thread/dacc3bdc5b1e1d67

Tom van der Woerdt

unread,
Dec 18, 2010, 8:01:04 AM12/18/10
to twitter-deve...@googlegroups.com
Hello David,

Currently the API does not shorten the links for you yet. In the future
Twitter may implement this, but currently you will have to shorten the
links yourself, via (for example) bit.ly.

Tom

David E. Wheeler

unread,
Dec 18, 2010, 8:17:36 PM12/18/10
to twitter-deve...@googlegroups.com
On Dec 18, 2010, at 5:01 AM, Tom van der Woerdt wrote:

> Currently the API does not shorten the links for you yet. In the future Twitter may implement this, but currently you will have to shorten the links yourself, via (for example) bit.ly.

That's what I thought. Thanks for the confirmation.

Best,

David

Emil Tullstedt

unread,
Dec 20, 2010, 7:16:22 AM12/20/10
to twitter-deve...@googlegroups.com
As for bit.ly, there is an API for bit.ly which aids you in using URL-shortening until t.co is finished..
-- 
Emil "sakjur" Tullstedt
~~~~~~~~~~



--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk

David E. Wheeler

unread,
Dec 20, 2010, 1:21:32 PM12/20/10
to twitter-deve...@googlegroups.com
On Dec 20, 2010, at 4:16 AM, Emil Tullstedt wrote:

> As for bit.ly, there is an API for bit.ly which aids you in using URL-shortening until t.co is finished..

Yeah, but it's rate-limited. I'm using http://s.coop/ for now. Dead simple.

Best,

David

M. Edward (Ed) Borasky

unread,
Dec 20, 2010, 3:16:23 PM12/20/10
to twitter-deve...@googlegroups.com

*All* services are rate-limited and *none* are free. ;-)
--
http://twitter.com/znmeb http://borasky-research.net

"A mathematician is a device for turning coffee into theorems." -- Paul
Erdős

David E. Wheeler

unread,
Dec 20, 2010, 4:16:00 PM12/20/10
to twitter-deve...@googlegroups.com
On Dec 20, 2010, at 12:16 PM, M. Edward (Ed) Borasky wrote:

>> Yeah, but it's rate-limited. I'm using http://s.coop/ for now. Dead
> simple.
>>
>> Best,
>>
>> David
>
> *All* services are rate-limited and *none* are free. ;-)

True.

David

David E. Wheeler

unread,
Jan 12, 2011, 1:58:03 PM1/12/11
to twitter-deve...@googlegroups.com
On Dec 18, 2010, at 5:17 PM, David E. Wheeler wrote:

>> Currently the API does not shorten the links for you yet. In the future Twitter may implement this, but currently you will have to shorten the links yourself, via (for example) bit.ly.
>
> That's what I thought. Thanks for the confirmation.

It appears that Twitter 2 for the Mac somehow does what I was describing. Try typing or pasting a URL into it; it stops counting characters once it recognizes it as a URL. You can also send tweets that are over 140 characters due to a long URL; it does the shortening using t.co. How does it do it? Is there an API for that?

I'm doing the same thing in my app, but using s.coop. would be nice just to be able to send stuff to the API an let it do the shortening. I don't suppose that's how it works…

Any ideas?

Best,

David

Abraham Williams

unread,
Jan 12, 2011, 2:41:54 PM1/12/11
to twitter-deve...@googlegroups.com
I would not recommend using it yet but Twitter for Mac is using the endpoint /urls/shorten.json?url=http://example.com


Abraham
-------------
Abraham Williams | Hacker Advocate | abrah.am
@abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.




Best,

David

David E. Wheeler

unread,
Jan 12, 2011, 3:18:30 PM1/12/11
to twitter-deve...@googlegroups.com
On Jan 12, 2011, at 11:41 AM, Abraham Williams wrote:

> I would not recommend using it yet but Twitter for Mac is using the endpoint
> /urls/shorten.json?url=http://example.com
>
> http://t.co/6wD3idD

Ah, that's pretty nice. Pity the API doesn't do it magically for you, but this will be a good compromise. I wonder if there is or will be a parameter that causes the short link to simply be returned as the content, like many of the shortening services offer (not goo.gl, alas). It's nice not to have to parse anything if all you need is a link.

I look forward to seeing this documented/announced at some point…thank for the pointer, Abraham.

Best,

David

Reply all
Reply to author
Forward
0 new messages