Skip to content

telexintegrations/Twitter_trending_posts

Repository files navigation

Twitter NG Trends Monitor

Twitter NG Trends Monitor is a FastAPI application that retrieves the 5 latest tweets from the top 10 trending tweets on Twitter Nigeria.

Project Structure

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. 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'

Usage

  1. Run the FastAPI application:

    uvicorn main:app --reload
  2. The application will be available at http://127.0.0.1:8000.

API Endpoints

Get Integration JSON

  • 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"
        }
    }

Images

Images

Channel integration 1 Channel integration 2

Monitor Task

  • 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"
    }

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages