t.co reverse

343 views
Skip to first unread message

Amaury

unread,
Jan 7, 2011, 9:59:47 AM1/7/11
to Twitter Development Talk
Hi guys !

Thanks to new Mac OS Twitter client a lot of URL in tweets are now
convert to t.co witch is include in API response for user/
timeline ...

Is there any way to reverse t.co simply like we can do with bit.ly
API ?


Thanks

@Amaury

Taylor Singletary

unread,
Jan 7, 2011, 10:38:08 AM1/7/11
to twitter-deve...@googlegroups.com
Hi Amaury,

There currently isn't a distinct API available to de-reference t.co URLs (or directly produce them). However, most REST API timeline and status-bearing methods support the include_entities=true parameter which will include an additional set of fields, including "unrolled" t.co URLs. You can read more about entities here: http://dev.twitter.com/pages/tweet_entities

For example with this request:

The tweet text was:
"text": "Emergent Behavior in Twitter Culture http://t.co/bcUPYxi via @adage",

And the entities node shows the de-referenced URL in entities/urls[0]/expanded_url:

"entities": {
  "places": [],
  "urls": [
    {
      "expanded_url": "http://adage.com/u/rby1pa",
      "url": "http://t.co/bcUPYxi",
      "indices": [
        37,
        56
      ],
      "display_url": "adage.com/u/rby1pa"
    }
  ],
  "hashtags": [],
  "user_mentions": [
    {
      "name": "Ad Age",
      "id_str": "12480582",
      "id": 12480582,
      "indices": [
        61,
        67
      ],
      "screen_name": "adage"
    }
  ]
}

Thanks,
Taylor


--
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

Reply all
Reply to author
Forward
0 new messages