0

hey i have an array (pasted below) of URLs taken from a user's most recent tweets and i would like to omit any URLs that are from Instagram or twit pic. any suggestions on how to do this with JS?

[http://t.co/teuS5YQtU3,
http://t.co/BdxtMuGsOa,
http://t.co/Z27G15Z7Mo,
http://t.co/vqQus6gDmn,
http://t.co/70ce18HJct,
http://t.co/yy15EXWgex,
http://t.co/xhNDyLqvrW,
http://t.co/JE04mFLs…,
http://t.co/uvuIdyliPT,
http://t.co/itBY9sw9GT,
http://t.co/eYY4QeySyP,
http://t.co/fJ6ymgIy0N]
NateH
  • 85
  • 1
  • 7
  • Those are shortened URLS so there's not way to differentiate between and instagram and twitpic URL. Supplying the full URL would be more helpful – dcodesmith Apr 09 '14 at 21:56
  • If you are using any server-side technology you can send a request and see where they redirect. As dcodesmith said, you won't be able to know with JavaScript. Even if you try to do an Ajax request, you won't know because of the [Same Origin Policy](http://en.wikipedia.org/wiki/Same-origin_policy). – Hanlet Escaño Apr 09 '14 at 21:57
  • Thanks. I ended up using the Embed.ly Extract api to get the full URL from the shortened: http://embed.ly/extract – NateH Apr 13 '14 at 19:18

0 Answers0