{"id":30143896,"url":"https://github.com/tssujt/twikit-rss","last_synced_at":"2025-08-11T07:34:55.555Z","repository":{"id":307285147,"uuid":"1028941763","full_name":"tssujt/twikit-rss","owner":"tssujt","description":"A FastAPI web service that generates RSS feeds from Twitter user timelines and lists using [twikit](https://github.com/d60/twikit).","archived":false,"fork":false,"pushed_at":"2025-07-30T11:09:49.000Z","size":40,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T13:54:43.778Z","etag":null,"topics":["feed","python","rss","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tssujt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-30T09:35:18.000Z","updated_at":"2025-07-30T11:08:47.000Z","dependencies_parsed_at":"2025-07-30T13:54:51.824Z","dependency_job_id":"4fce120c-a093-41e1-b502-c7b1b9f55709","html_url":"https://github.com/tssujt/twikit-rss","commit_stats":null,"previous_names":["tssujt/twikit-rss"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tssujt/twikit-rss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tssujt%2Ftwikit-rss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tssujt%2Ftwikit-rss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tssujt%2Ftwikit-rss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tssujt%2Ftwikit-rss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tssujt","download_url":"https://codeload.github.com/tssujt/twikit-rss/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tssujt%2Ftwikit-rss/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269849193,"owners_count":24485151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feed","python","rss","twitter","twitter-api"],"created_at":"2025-08-11T07:34:51.537Z","updated_at":"2025-08-11T07:34:55.538Z","avatar_url":"https://github.com/tssujt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twikit-rss\n\n[![uv](https://img.shields.io/badge/uv-dependency_manager-blue)](https://github.com/astral-sh/uv)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![isort](https://img.shields.io/badge/isort-imports_sorted-yellow)](https://github.com/PyCQA/isort)\n[![mypy](https://img.shields.io/badge/mypy-checked-blue)](https://github.com/python/mypy)\n\nA FastAPI web service that generates RSS feeds from Twitter user timelines and lists using [twikit](https://github.com/d60/twikit).\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone \u003cyour-repo-url\u003e\ncd twikit-rss\n\n# Install using uv\nuv sync\n\n# Install pre-commit hooks (optional but recommended)\npre-commit install\n```\n\n## Configuration\n\nCreate a `.env` file in the project root with your Twitter credentials:\n\n```env\nTWITTER_USERNAME=your_username\nTWITTER_EMAIL=your_email@example.com\nTWITTER_PASSWORD=your_password\n\n# Optional proxy support\nTWITTER_PROXY=http://proxy.example.com:8080\n```\n\n## Usage\n\n### Starting the Service\n\n```bash\n# Start the web service\npython start_server.py\n\n# Or directly with uvicorn\nuvicorn twikit_rss.app:app --host 0.0.0.0 --port 8000\n```\n\nThe service will be available at `http://localhost:8000`\n\n### API Endpoints\n\n#### Get API Information\n```http\nGET /\n```\n\n#### Generate RSS feed for user timeline\n```http\nGET /user/{username}/rss?count=20\u0026title=Custom+Title\u0026description=Custom+Description\n```\n\nExample:\n```bash\ncurl \"http://localhost:8000/user/elonmusk/rss?count=10\"\n```\n\n#### Generate RSS feed for Twitter list\n```http\nGET /list/{list_id}/rss?count=20\u0026title=Custom+Title\u0026description=Custom+Description\n```\n\nExample:\n```bash\ncurl \"http://localhost:8000/list/123456789/rss?count=15\"\n```\n\n#### Health Check\n```http\nGET /health\n```\n\n### Query Parameters\n\nAll RSS endpoints support the following optional query parameters:\n\n- `count` (int): Number of tweets to fetch (default: 20)\n- `title` (string): Custom RSS feed title\n- `description` (string): Custom RSS feed description\n\n## Features\n\n- ✅ **FastAPI Web Service** - Modern async web framework\n- ✅ **RSS Feed Generation** - Standards-compliant RSS 2.0 XML\n- ✅ **User Timeline Feeds** - Get RSS feeds from any public Twitter user\n- ✅ **Twitter List Feeds** - Get RSS feeds from Twitter lists\n- ✅ **Persistent Authentication** - Automatic cookie-based session management\n- ✅ **Proxy Support** - Optional HTTP proxy configuration for network restrictions\n- ✅ **Environment Configuration** - Secure credential management via `.env`\n- ✅ **Configurable Parameters** - Custom titles, descriptions, and tweet counts\n- ✅ **Rich Content** - Includes tweet text, author info, and engagement metrics\n- ✅ **Comprehensive Logging** - Detailed logging for debugging and monitoring\n- ✅ **Type Safety** - Full type annotations with mypy checking\n- ✅ **Code Quality** - Pre-commit hooks with ruff linting and formatting\n\n## Authentication\n\nThe service uses [twikit](https://github.com/d60/twikit) for Twitter authentication. It supports:\n\n1. **Environment Variables**: Loads credentials from `.env` file\n2. **Cookie Persistence**: Automatically saves and reuses authentication cookies\n3. **Automatic Re-authentication**: Falls back to credentials if cookies expire\n\nAuthentication cookies are stored at: `~/.twikit-rss/cookies.json`\n\n## Development\n\n### Code Quality\n\n```bash\n# Run all quality checks\npre-commit run --all-files\n\n# Individual tools\nruff check .          # Linting\nruff format .         # Formatting\nmypy .               # Type checking\nuv lock --check      # Dependency checks\n```\n\n## Dependencies\n\n- **[FastAPI](https://fastapi.tiangolo.com/)** - Modern web framework\n- **[twikit](https://github.com/d60/twikit)** - Twitter API client\n- **[feedgen](https://feedgen.kiesow.be/)** - RSS/Atom feed generation\n- **[uvicorn](https://www.uvicorn.org/)** - ASGI server\n- **[python-dotenv](https://github.com/theskumar/python-dotenv)** - Environment variable management\n\n### Development Dependencies\n\n- **[ruff](https://github.com/astral-sh/ruff)** - Fast Python linter and formatter\n- **[isort](https://github.com/PyCQA/isort)** - Python import sorting\n- **[mypy](https://mypy.readthedocs.io/)** - Static type checker\n- **[pre-commit](https://pre-commit.com/)** - Git hooks framework\n\n## API Response Format\n\nThe RSS endpoints return valid RSS 2.0 XML with proper content-type headers:\n\n```xml\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003crss version=\"2.0\"\u003e\n  \u003cchannel\u003e\n    \u003ctitle\u003eTwitter Timeline: @username\u003c/title\u003e\n    \u003clink\u003ehttps://twitter.com/username\u003c/link\u003e\n    \u003cdescription\u003eRecent tweets from @username\u003c/description\u003e\n    \u003citem\u003e\n      \u003ctitle\u003e@username: Tweet content...\u003c/title\u003e\n      \u003clink\u003ehttps://twitter.com/username/status/123456789\u003c/link\u003e\n      \u003cdescription\u003eFull tweet with engagement metrics\u003c/description\u003e\n      \u003cpubDate\u003eWed, 30 Jul 2025 12:34:56 +0000\u003c/pubDate\u003e\n      \u003cauthor\u003eusername@twitter.com (@username)\u003c/author\u003e\n    \u003c/item\u003e\n  \u003c/channel\u003e\n\u003c/rss\u003e\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftssujt%2Ftwikit-rss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftssujt%2Ftwikit-rss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftssujt%2Ftwikit-rss/lists"}