MobMin / digital_atlas

A detailed overview of the digital and spiritual landscape for the countries of the world.
GNU General Public License v3.0
17 stars 5 forks source link

05-05-2022: As a visitor, I would love to see the top 20 Twitter trends for the specific country. #28

Closed codemis closed 1 year ago

codemis commented 2 years ago

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):

Screen Shot 2022-08-31 at 9 45 51 AM

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.