Twitter NG Trends Monitor is a FastAPI application that retrieves the 5 latest tweets from the top 10 trending tweets on Twitter Nigeria.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Create a .env file in the root directory with the following content:
TWITTER_USERNAME = 'your_twitter_username' TWITTER_EMAIL = 'your_twitter_email' TWITTER_PASSWORD = 'your_twitter_password'
-
Run the FastAPI application:
uvicorn main:app --reload
-
The application will be available at
http://127.0.0.1:8000.
- URL:
/application.json - Method:
GET - Response:
{ "data": { "date": { "created_at": "2025-02-20", "updated_at": "2025-02-20" }, "descriptions": { "app_name": "Twitter NG Trends Monitor", "app_description": "Retrieves the 5 latest tweets from the top 10 trending tweets on Twitter Ng", "app_url": "http://127.0.0.1:8000", "app_logo": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSzqnmyNlygtds5hKfmdUIXfzlFkqzQDuack_Y0ekPJpqaJO-R1JgbgszHZEApPN9oNPpw&usqp=CAU" }, "key_features": [ "Fetches the 5 latest tweets from the top 10 trending tweets on Twitter Ng", "Runs every hour", "Logs the tweets" ], "integration_category": "Monitoring & Logging", "integration_type": "interval", "settings": [{"label": "interval", "type": "text", "required": True, "default": "0 * * * *"}], "tick_url": "http://127.0.0.1:8000/tick" } }
- URL:
/tick - Method:
POST - Request Body:
{ "channel_id": "your_channel_id", "return_url": "your_return_url", "settings": [ { "label": "interval", "type": "text", "required": true, "default": "0 * * * *" } ] } - Response:
{ "status": "accepted" }
This project is licensed under the MIT License.

