{"id":31262580,"url":"https://github.com/carvalhocaio/sahlo-folina","last_synced_at":"2025-09-23T11:28:26.062Z","repository":{"id":314667727,"uuid":"1056349666","full_name":"carvalhocaio/sahlo-folina","owner":"carvalhocaio","description":"Bot automatizado que seleciona músicas aleatórias do Twenty One Pilots de uma playlist no Spotify e envia para um canal do Discord via webhook.","archived":false,"fork":false,"pushed_at":"2025-09-13T23:04:34.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-14T00:25:46.316Z","etag":null,"topics":["python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carvalhocaio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-13T22:38:53.000Z","updated_at":"2025-09-13T23:04:38.000Z","dependencies_parsed_at":"2025-09-14T00:25:50.198Z","dependency_job_id":"66d4f530-78ff-48d5-b091-4d1da1270910","html_url":"https://github.com/carvalhocaio/sahlo-folina","commit_stats":null,"previous_names":["carvalhocaio/sahlo-folina"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/carvalhocaio/sahlo-folina","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carvalhocaio%2Fsahlo-folina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carvalhocaio%2Fsahlo-folina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carvalhocaio%2Fsahlo-folina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carvalhocaio%2Fsahlo-folina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carvalhocaio","download_url":"https://codeload.github.com/carvalhocaio/sahlo-folina/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carvalhocaio%2Fsahlo-folina/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276564948,"owners_count":25664925,"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-09-23T02:00:09.130Z","response_time":73,"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":["python"],"created_at":"2025-09-23T11:28:22.119Z","updated_at":"2025-09-23T11:28:26.049Z","avatar_url":"https://github.com/carvalhocaio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sahlo Folina\n\nAutomated bot that selects random Twenty One Pilots songs from a Spotify playlist and sends them to a Discord channel via webhook.\n\n## Purpose\n\n**Sahlo Folina** is a project that connects Twenty One Pilots fans through daily music. The bot:\n\n- Randomly selects a song from a specific Spotify playlist\n- Sends the song of the day to a Discord channel with a custom embed\n\n## Features\n\n- **Random Selection**: Fetches random songs from Spotify playlist\n- **Discord Integration**: Sends formatted embeds to Discord channels\n- **Custom Design**: Twenty One Pilots themed visuals\n- **Direct Links**: Links to Spotify\n\n## Project Structure\n\n```\nsahlo-folina/\n├── src/\n│   ├── __init__.py             # Package initialization\n│   ├── main.py                 # Main file\n│   ├── config.py               # Configuration and environment variables\n│   ├── spotify_service.py      # Spotify integration service\n│   └── discord_service.py      # Discord webhook service\n├── .env.example                # Environment variables example\n├── requirements.txt            # Project dependencies\n├── Makefile                    # Development commands\n└── README.md                   # This file\n```\n\n## Dependencies\n\n### System Requirements\n- Python 3.12+\n- Python virtual environment\n\n### Python Libraries\n- `spotipy==2.23.0` - Spotify Web API integration\n- `python-dotenv==1.0.0` - Environment variables management\n- `aiohttp==3.9.1` - Asynchronous HTTP client for Discord webhooks\n\n### Required APIs\n- **Spotify Web API** - To access song information\n- **Discord Webhook** - To send messages to Discord channels\n\n## Configuration\n\n### 1. Environment Variables\n\nCopy the `.env.example` file to `.env`:\n\n```bash\ncp .env.example .env\n```\n\nConfigure the following variables:\n\n```env\n# Spotify API\nSPOTIFY_CLIENT_ID=your_spotify_client_id\nSPOTIFY_CLIENT_SECRET=your_spotify_client_secret\nSPOTIFY_PLAYLIST_ID=your_twenty_one_pilots_playlist_id\n\n# Discord Webhook\nDISCORD_WEBHOOK_URL=your_discord_webhook_url\n```\n\n### 2. How to Obtain Credentials\n\n#### Spotify API\n1. Go to [Spotify for Developers](https://developer.spotify.com/)\n2. Create a new app\n3. Copy the Client ID and Client Secret\n4. For the Playlist ID, use the Twenty One Pilots playlist ID\n\n#### Discord Webhook\n1. In your Discord server, go to Channel Settings\n2. Integrations \u003e Webhooks \u003e New Webhook\n3. Copy the webhook URL\n\n## Installation and Execution\n\n### 1. Clone the Repository\n```bash\ngit clone \u003crepository-url\u003e\ncd sahlo-folina\n```\n\n### 2. Set up Virtual Environment\n```bash\npython -m venv .venv\nsource .venv/bin/activate  # Linux/Mac\n# or\n.venv\\Scripts\\activate     # Windows\n```\n\n### 3. Install Dependencies\n```bash\n# With uv (recommended)\nuv pip install -r requirements.txt\n\n# Or with traditional pip\npip install -r requirements.txt\n```\n\n### 4. Configure Environment Variables\nEdit the `.env` file with your credentials (see Configuration section).\n\n### 5. Run the Bot\n```bash\n# Activate virtual environment\nsource .venv/bin/activate\n\n# Run the bot\npython src/main.py\n\n# Or using Makefile\nmake run\n```\n\n## Development\n\n### Available Commands (Makefile)\n\n```bash\n# Run the project\nmake run\n\n# Check code (linting)\nmake lint\n\n# Format code automatically\nmake format\n```\n\n### Formatting and Linting\n\nThe project uses **Ruff** for Python code formatting and linting:\n\n- Configuration in `ruff.toml`\n- Run checks: `make lint`\n- Automatic formatting: `make format`\n\n### Code Structure\n\n- **Modular**: Each service (Spotify, Discord) in separate files\n- **Async/Await**: Asynchronous operations for better performance\n- **Type Hints**: Python typing for better documentation\n- **Error Handling**: Error handling in all operations\n\n## How to Use\n\n1. Configure all environment variables\n2. Run the bot: `python src/main.py`\n3. The bot will:\n  - Fetch a random song from the playlist\n  - Send it to Discord with formatted embed\n\n## Contributing\n\n1. Fork the project\n2. Create a branch for your feature (`git checkout -b feature/:name`)\n3. Commit your changes (`git commit -m 'Add some feature'`)\n4. Push to the branch (`git push origin feature/:name`)\n5. Open a Pull Request\n\n\n---\n\n**FPE |-/**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarvalhocaio%2Fsahlo-folina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarvalhocaio%2Fsahlo-folina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarvalhocaio%2Fsahlo-folina/lists"}