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
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
> 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
--
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
> 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
*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
>> 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
>> 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
Best,
David
> 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