When a visitor finds a country, they would like to see a widget displaying the top 20 Twitter trends for that country. Each trend should include a link to Twitter where they can see the results of the trend.
Solution
Using an elevated Twitter API account, which we have obtained, we need to collect two pieces of information from Twitter. First, we need to identify which locations provide trend data using the trends/available endpoint. This will give us the country code for each country that has trend data.
Second, we need to use the trends/place endpoint to get the latest trends. We should run this on a cron job once/twice a day.
Design
We will store the data in a table ordered by tweet_count in descending order. If there is no tweet_count, then use a -. All links should have a target="_blank" Here is an example of the table (I am only showing 5 results, but you want 20):
NOTE: If a country does not provide twitter trends, we should hide the widget.
Additional Information
You will need to retrieve API credentials from @codemis. You will also need to install a dependency in the project that uses this PHP Twitter API library.
Description
When a visitor finds a country, they would like to see a widget displaying the top 20 Twitter trends for that country. Each trend should include a link to Twitter where they can see the results of the trend.
Solution
Using an elevated Twitter API account, which we have obtained, we need to collect two pieces of information from Twitter. First, we need to identify which locations provide trend data using the trends/available endpoint. This will give us the country code for each country that has trend data.
Second, we need to use the trends/place endpoint to get the latest trends. We should run this on a cron job once/twice a day.
Design
We will store the data in a table ordered by tweet_count in descending order. If there is no tweet_count, then use a -. All links should have a target="_blank" Here is an example of the table (I am only showing 5 results, but you want 20):
NOTE: If a country does not provide twitter trends, we should hide the widget.
Additional Information
You will need to retrieve API credentials from @codemis. You will also need to install a dependency in the project that uses this PHP Twitter API library.