Spamming Twitter trending topics
Do you know why I love Twitter trending topics? Because trend pages attract many people. Everybody wants to know what's happening in Twitter. So why not to take the opportunity to drive some Twitter traffic?
How to get Twitter trends?
Easy, Twitter provides trends API. Here is PHP script that prints the top ten trending queries. (Don't forget to enable JSON in php.ini before running the script.)
<?php $contents = file_get_contents( "http://search.twitter.com/trends.json"); $json = json_decode($contents); foreach ($json->trends as $trend) { echo("<p><a href=\"" . $trend->url . "\">" . $trend->name . "</a></p>"); } ?>
How to get the real value of Twitter trends?
Write a Twitter spammer. A spam script obtains trends, finds relevant keywords (you don't want to spam all trends, do you?) and posts predefined messages. You may create multiple accounts to make more power! For example, each account is related to one niche. This way you don't miss keywords from different niches. Or do the opposite, two-three accounts related to one niche. This way you can retweet your tweets and post replies. What a drama!
Take care
July 26th, 2011 - 10:01
I wonder if Twitter would block or ban such type of scripts? Asking because this one was coded in 09.
-Jean
September 6th, 2011 - 20:01
You need to use a different call now as indicated here:
https://dev.twitter.com/docs/api/1/get/trends
Trends.json is no longer available
September 12th, 2011 - 09:28
Thanks for pointing that out! Seems that the file_get_contents line needs to be updated then.
-Jean