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

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.

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top