Recursive t.co and pic.twitter.com URLs


#1

What’s up with this?

When somebody copies and pastes a status to do a RT, the display_url winds up in the clipboard. It seems twitter assigns it an entirely new t.co and pic.twitter.com link. But the status entities are showing the original t.co link, so I can’t regex the status text to update the shown URL.

Let me guess, that’s what indices are for? And I have to keep track of shifting positions after each replacement? No! :slight_smile:

"312613868243394560": { "author_id": "156819060", "reply_id": "312595282917474304", "text": "“@wwwbigbaldhead: Yes http://t.co/MIEOSXE6yL” @xxxBULLETxxx", "media": [ { "type": "photo", "url": "http://t.co/eF0b7Tb5xY", "display_url": "pic.twitter.com/eF0b7Tb5xY", "expanded_url": "http://twitter.com/wwwbigbaldhead/status/312595282917474304/photo/1", "media_url": "http://pbs.twimg.com/media/BFaPwO1CQAAgn_0.jpg", "indices": [ 22, 44 ] } ], "user_mentions": [ { "id": "25460615", "screen_name": "wwwbigbaldhead", "name": "norman reedus", "indices": [ 1, 16 ] }, { "id": "402415732", "screen_name": "xxxBULLETxxx", "name": "Jeremiah Todd", "indices": [ 46, 59 ] } ], "created_at": "Fri Mar 15 17:18:48 +0000 2013" }

#2

You guessed right about what the indicies are for :slight_smile: