{"id":20106819,"url":"https://github.com/nneji123/raplyricsbot","last_synced_at":"2025-05-06T09:32:09.109Z","repository":{"id":53862882,"uuid":"521352325","full_name":"Nneji123/RapLyricsBot","owner":"Nneji123","description":"A Twitter Bot that tweets random rap lyrics made with Python and Tweepy.","archived":false,"fork":false,"pushed_at":"2022-08-21T18:32:51.000Z","size":2160,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T21:57:11.612Z","etag":null,"topics":["bot","docker","fastapi","flask","gitpod","heroku","python","railway","tests","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"https://twitter.com/__Raplyrics","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/Nneji123.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}},"created_at":"2022-08-04T17:13:07.000Z","updated_at":"2022-11-03T09:37:17.000Z","dependencies_parsed_at":"2022-08-13T03:10:23.638Z","dependency_job_id":null,"html_url":"https://github.com/Nneji123/RapLyricsBot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nneji123%2FRapLyricsBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nneji123%2FRapLyricsBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nneji123%2FRapLyricsBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nneji123%2FRapLyricsBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nneji123","download_url":"https://codeload.github.com/Nneji123/RapLyricsBot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252657336,"owners_count":21783801,"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","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":["bot","docker","fastapi","flask","gitpod","heroku","python","railway","tests","twitter","twitter-api"],"created_at":"2024-11-13T17:54:51.059Z","updated_at":"2025-05-06T09:32:07.925Z","avatar_url":"https://github.com/Nneji123.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RapLyricsBot :robot:\n\n[![Language](https://img.shields.io/badge/Python-darkblue.svg?style=flat\u0026logo=python\u0026logoColor=white)](https://www.python.org)\n[![Framework](https://img.shields.io/badge/Flask-darkgreen.svg?style=flat\u0026logo=flask\u0026logoColor=white)](https://github.com/Nneji123/Raplyricsbot)\n![hosted](https://img.shields.io/badge/Railway-430098?style=flat\u0026logo=railway\u0026logoColor=white)\n![hosted](https://img.shields.io/badge/Heroku-430098?style=flat\u0026logo=heroku\u0026logoColor=white)\n[![Twitter](https://img.shields.io/badge/Twitter-blue.svg?style=flat\u0026logo=twitter\u0026logoColor=white)](https://twitter.com/__RapLyricsBot)\n![Docker](https://img.shields.io/badge/Docker-blue?style=flat\u0026logo=docker\u0026logoColor=white)\n[![Gitpod](https://img.shields.io/badge/Gitpod-orange?style=flat\u0026logo=gitpod\u0026logoColor=white)](https://gitpod.io/#https://github.com/Nneji123/RapLyricsBot)\n![reposize](https://img.shields.io/github/repo-size/Nneji123/RapLyricsBot)\n[![tests](https://github.com/Nneji123/RapLyricsBot/actions/workflows/test.yml/badge.svg)](https://github.com/Nneji123/RapLyricsBot/actions/workflows/test.yml)\n[![CodeQL](https://github.com/Nneji123/RapLyricsBot/actions/workflows/codeql.yml/badge.svg)](https://github.com/Nneji123/RapLyricsBot/actions/workflows/codeql.yml)\n\n\n\n## About :speech_balloon:\n\u003eA Twitter Bot that tweets Rap lyrics made with Python, Tweepy and Flask and deployed with RailWay.\n\nTwitter: https://twitter.com/__RapLyrics\n\n\n\n\n## Contents :page_with_curl:\n  * [About :speech_balloon:](#about--speech-balloon-)\n  * [Contents :page_with_curl:](#contents--page-with-curl-)\n  * [Features :star2:](#features--star2-)\n  * [Repository File Structure :file_folder:](#repository-file-structure--file-folder-)\n  * [Pre-requisites :boom:](#pre-requisites--boom-)\n  * [How to run the Application :question:](#how-to-run-the-application--question-)\n  * [Tests :keyboard:](#tests--keyboard-)\n  * [Deployment :computer:](#deployment--computer-)\n- [Todo :bookmark_tabs:](#todo--bookmark-tabs-)\n- [License :page_with_curl:](#license--page-with-curl-)\n\n\n\n## Features :star2:\nThe bot works by reading and parsing a text file containing the lyrics. The text file can be found [here.](https://github.com/Nneji123/Raplyricsbot/data/Rap_lyrics.txt) The code can be found in the [src](https://github.com/Nneji123/Raplyricsbot/src) folder.\n\n\n\n## Repository File Structure :file_folder:\n```bash\n├───.github # Github Workflows\n│   └───workflows\n├── app.json # For Deploying to Heroku\n├── data\n│   └── Rap_lyrics.txt # lyrics file\n├── docker-compose.yml # For Containerization with Docker\n├── Dockerfile\n├── LICENSE \n├── README.md\n├── Procfile # For deploying to Heroku and Railway\n├── requirements.txt\n├── src\n│   ├── bot.py # Tweet bot\n│   ├── __init__.py\n│   ├── server.py # flask server\n├── tests # Tests folder\n    ├── __init__.py\n    └── test_bot.py\n\n```\n\n## Pre-requisites :boom:\n\nTo build and use the bot, you'll need to:\n \n 1. Create a new Twitter account to act as the bot.\n 2. Register for a [twitter developer account.](https://developer.twitter.com/en)  \n 3. Create a [twitter app](https://developer.twitter.com/en/portal/projects-and-apps). Make sure to give it **Read and Write** permissions.\n 4. Set up a [Railway](https://railway.app/) or [Heroku Account.](https://heroku.com)\n\n \n\n\n## How to run the Application :question:\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cb\u003eHow to Run the application locally.\u003cb\u003e\u003c/summary\u003e\n\n\nTo make your own bot follow these steps:\n\n1. Clone this repository on your local machine\n2. Create a virtual environment in your project's root directory: `python3 -m venv environment \u0026\u0026 source environment/bin/activate`\n3. Install the required libraries using pip: `pip install -r requirements.txt`\n4. Create a file called `.env` in the root directory of your project. Put your twitter App keys there (and any other keys required for scraping data if needed). \n    * THIS IS JUST FOR TESTING. Once everything is tested and ready to deploy, you'll move these to environment variables.\n    * ADD THIS FILE(`.env`) TO THE .gitignore so you're not putting your api keys publicly on github!\n```\nACCESS_TOKEN=\u003cYOUR_ACCESS_TOKEN_HERE\u003e\nACCESS_TOKEN_SECRET=\u003cYOUR_ACCESS_TOKEN_SECRET_HERE\u003e\nCONSUMER_KEY=\u003cYOUR_CONSUMER_KEY_HERE\u003e\nCONSUMER_SECRET=\u003cYOUR_CONSUMER_SECRET_HERE\u003e\n```\n1. Make changes in the logic of the bot by modyifing `src/bot.py`\n2. Test your changes locally by running `python src/bot.py` from the root directory of your project\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e \n  \u003csummary\u003e\u003cb\u003eRunning on Local Machine with Docker Compose\u003c/b\u003e\u003c/summary\u003e\n\n**You can also run the application in a docker container using docker compose(if you have it installed)**\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/Nneji123/RapLyricsBot.git\n```\n\n2. Change the directory:\n```\ncd RapLyricsBot\n```\n\n3. Edit the `.envexample` file and store your keys there.\n\n\n4. Run the docker compose command\n```docker\ndocker compose up -d --build \n```\nAnd then the lyrics should be tweeted.\n\u003c/details\u003e\n\n\n\u003cdetails\u003e \n  \u003csummary\u003e\u003cb\u003eRunning in a Gitpod Cloud Environment\u003c/b\u003e\u003c/summary\u003e\n\n\n**Click the button below to start a new development environment:**\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Nneji123/RapLyricsBot)\n\u003c/details\u003e\n\n## Tests :keyboard:\n\u003cdetails\u003e \n  \u003csummary\u003e\u003cb\u003eTest Bot\u003c/b\u003e\u003c/summary\u003e\n\nTo test the API functions do the following:\n1. Clone the repository:\n```\ngit clone https://github.com/Nneji123/RapLyricsBot.git\n```\n2. Change the working directory and install the requirements and pytest:\n```\ncd Raplyricsbot\npip install -r requirements.txt\n```\n3. Move to the tests folder and run the tests\n```\npip install pytest\npytest tests\n```\n\u003c/details\u003e\n\n## Deployment :computer:\n\n\u003cdetails\u003e \n  \u003csummary\u003e\u003cb\u003eDeploying the Bot to Heroku\u003c/b\u003e\u003c/summary\u003e\n\nClick the button below to deploy the application.\n\n[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)\n\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cb\u003eDeploy the Bot to Railway\u003cb\u003e\u003c/summary\u003e\nClick the button below to deploy the bot to railway\n\n[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/k_WXDI?referralCode=ZYOf2M)\n\n\u003c/details\u003e\n\n\n# Todo :bookmark_tabs:\n- [x] Add more lyrics\n- [x] Change this from a Rap lyrics bot to a general rap bot\n- [x] Get more lyrics using this library https://github.com/johnwmillr/LyricsGenius\n- [x] Update Readme.\n- [x] Update tests\n\n\n# License :page_with_curl:\n[MIT](https://github.com/Nneji123/RapLyricsBot/LICENSE.md)\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnneji123%2Fraplyricsbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnneji123%2Fraplyricsbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnneji123%2Fraplyricsbot/lists"}