Twitter::Status#all_urls method #205

Merged
merged 1 commit into from Oct 20, 2011

Conversation

Projects
None yet
2 participants
Contributor

seanmoon commented Oct 20, 2011

Hey there,

So it looks like depending on how old your tweet is (especially before the Oct 11 2011 t.co switch) you'll see very different entities and URLS and such in Twitter's API response.

Here's a tweet's URL entities (id 126406520777867266) and text from a few days ago:

"urls": [ 
    { 
        "url": "http://t.co/y0miz6cf", 
        "display_url": "instagr.am/p/Qnszj/", 
        "expanded_url": "http://instagr.am/p/Qnszj/" 
    } 
], 
"text": "The Internet  http://t.co/y0miz6cf" 

Whereas here is a tweet from July 25 2009 (id 2843006385):

"urls": [ 
    { 
        "url": "http://twitpic.com/bm7ob", 
        "expanded_url": null 
    } 
],
"text": "Computer time!  http://twitpic.com/bm7ob" 

What would help me (and perhaps others?) work with these sort of inconsistent responses is a method that returns all the URLs that are associated with the tweet so that one can work with a consistent interface regardless of the age of the tweet.

Thanks!

Sean

Owner

sferik commented Oct 20, 2011

Looks good. Thanks for the patch.

sferik merged commit 70308e2 into sferik:master Oct 20, 2011

Contributor

seanmoon commented Oct 20, 2011

You're quick! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment