Nitter-Rss-Proxy
is a proxy server designed to integrate seamlessly with Nitter's RSS feeds. It offers optimal performance and reliability by employing FastAPI and Redis.
- Features
- Prerequisites
- Installation & Setup
- Usage
- Code Structure
- Dependencies
- Credits
- Contribution
- License
- FastAPI Integration: Builds a robust web server using FastAPI.
- Redis Integration: Utilizes Redis for efficient caching and data management.
- Docker Support: Includes Docker configurations for streamlined deployment.
Before you begin, make sure you have Docker Compose installed on your machine. This project uses Docker Compose for orchestrating the application and Redis containers, which simplifies the deployment process.
- Docker Compose:
v2.22.0-desktop.2
.
Clone the Repository
git clone https://github.com/shirser121/Nitter-Rss-Proxy.git
-
Build the Docker Image
docker-compose build
-
Deploy Using Docker-Compose
docker-compose up -d
-
Install the Dependencies
pip install -r requirements.txt
-
Make sure Redis is running
-
Run the application
uvicorn rss_proxy.main:app
The project uses environment variables for configuration. Below is a list of environment variables used by the project along with their default values.
Variable | Description | Default Value |
---|---|---|
BASE_URL |
The base URL for the status API. | https://status.d420.de/api/v1/instances |
REDIS_HOST |
The hostname of your Redis instance. | localhost |
REDIS_PORT |
The port number on which Redis is running. | 6379 |
REDIS_CACHE_DURATION_SECONDS |
Cache duration for Redis in seconds. | 120 (2 minutes) |
HOSTS_CACHE_DURATION_SECONDS |
Cache duration for hosts in seconds. | 86400 (24 hours) |
To override any of these values, you can set environment variables in your shell before running the application, or you can use a .env
file.
Example .env
file:
BASE_URL=https://new_base_url/api/v1/instances
REDIS_HOST=new_redis_host
REDIS_PORT=6380
REDIS_CACHE_DURATION_SECONDS=300
HOSTS_CACHE_DURATION_SECONDS=7200
Access the proxy server at http://localhost:3010/
. The main endpoint will greet you with a welcome message.
The application provides a set of RESTful API endpoints to interact with the Nitter RSS proxy service.
- Description: Returns a welcome message.
- Response Payload: JSON object containing a welcome message.
-
Description: Proxies to a healthy RSS host to retrieve the RSS feed for the given Twitter username.
-
Parameters:
username
: The Twitter username (required).force_update
: Optional query parameter to force an update from the actual RSS source, bypassing cache.
-
Response Payload: RSS feed in XML format.
HTTP Status Codes:
200 OK
: The request was successful.404 Not Found
: The RSS feed or username was not found.
Install the project dependencies using the provided requirements.txt
file.
pip install -r requirements.txt
We owe a debt of gratitude to some remarkable projects and communities:
- Nitter: Kudos to Nitter for pioneering a privacy-centric Twitter front-end. Your work has been an inspiration.
- nitter-status: Special acknowledgment to nitter-status for the option get all the nitter instances status.
- twiiit: Thanks to twiiit for their work on a similar project.
We welcome contributions from the open-source community. Here's how you can help:
- Fork the Repository: Fork the main repository and clone it to your local machine.
- Create a New Branch: Create a new branch for your fixes or new features.
- Push Your Changes: Commit your changes and push them to your forked repository.
- Submit a Pull Request: Open a pull request to propose your changes to the main project.
For any questions, suggestions, or discussions, feel free to open an issue. We strive for a welcoming and open community.
This project is licensed under the MIT License. See the LICENSE file for details.