Finding all tweets which link to a specific domain (including shortlinks)

1.3k views Asked by At

I'm looking to find all tweets which link to example.com, including all tweets from the major shortlink providers - let's say just bitly, goo.gl, t.co and TinyURL for now (though I'm open to more suggestions). Clearly I can search using the Twitter API for all mentions of example.com - but does anyone have any suggestions as to how to best tackle the URL shortening cases, other than a brute force approach of gathering all shortened URLs and opening them to see where they redirect.

Thanks

2

There are 2 answers

0
Ina On BEST ANSWER

It seems there is no automated way to expand the short URLs and that the only way to reliably get them all would be to search for any short URL service links and then expand them manually. However, it is worth noting that the Twitter search API will automatically search the expanded versions of t.co links for you, which captures a good amount of URLs.

1
KaKa On

You might want to use tweet entities https://dev.twitter.com/docs/tweet-entities