{"id":24150767,"url":"https://github.com/hamidbyte/twitter-trending-hashtags-scraper-python","last_synced_at":"2025-11-26T06:03:42.347Z","repository":{"id":271812680,"uuid":"914635562","full_name":"HamidByte/Twitter-Trending-Hashtags-Scraper-Python","owner":"HamidByte","description":"This Python script scrapes the trending topics from the website trends24.in and generates hashtags from the trends. It supports filtering for English-only trends and ensures that the generated hashtags fit within Twitter's character limits.","archived":false,"fork":false,"pushed_at":"2025-02-08T06:28:19.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T07:23:04.997Z","etag":null,"topics":["hashtag","hashtag-generator","hashtag-scraper","hashtags","python","python3","trending-hashtags","trending-topics","twitter","x-com"],"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/HamidByte.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}},"created_at":"2025-01-10T01:50:39.000Z","updated_at":"2025-02-08T06:20:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"237a5d44-3f9d-47c8-870d-36186ff8a526","html_url":"https://github.com/HamidByte/Twitter-Trending-Hashtags-Scraper-Python","commit_stats":null,"previous_names":["hamidbyte/twitter-trending-hashtags-scraper-python"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamidByte%2FTwitter-Trending-Hashtags-Scraper-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamidByte%2FTwitter-Trending-Hashtags-Scraper-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamidByte%2FTwitter-Trending-Hashtags-Scraper-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamidByte%2FTwitter-Trending-Hashtags-Scraper-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HamidByte","download_url":"https://codeload.github.com/HamidByte/Twitter-Trending-Hashtags-Scraper-Python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241404454,"owners_count":19957657,"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":["hashtag","hashtag-generator","hashtag-scraper","hashtags","python","python3","trending-hashtags","trending-topics","twitter","x-com"],"created_at":"2025-01-12T09:12:39.819Z","updated_at":"2025-11-26T06:03:42.278Z","avatar_url":"https://github.com/HamidByte.png","language":"Python","readme":"# Twitter Trending Topics/Hashtags Scraper\n\nThis Python script scrapes the trending topics from the website trends24.in and generates hashtags from the trends. It supports filtering for English-only trends and ensures that the generated hashtags fit within Twitter's character limits.\n\n## Requirements\n\n- Python 3.x\n- Selenium\n- BeautifulSoup\n- WebDriver Manager\n- Regular expressions (for filtering)\n\nYou can install the required packages using pip:\n```bash\npip install selenium beautifulsoup4 webdriver-manager\n```\n\n## Usage\n\n1. Run the script:\n\n```bash\npython t3_scraper.py\n```\n\n2. The script will:\n\n- Open the trends24.in website.\n- Accept the cookie consent (if prompted).\n- Navigate to the \"Table\" section to gather trending topics.\n- Extract the trending topics along with additional information such as rank, position, count, and duration.\n- Optionally filter only English topics (if `ENGLISH_ONLY_REGEX` is set to `True`).\n- Create and print hashtags based on the most popular trends while adhering to Twitter's 280-character limit.\n\n## Configuration\n\n- `HEADLESS_MODE`: Set to `True` to run in headless mode (without opening a browser window).\n- `ENGLISH_ONLY_REGEX`: Set to `True` to filter for English-only trends based on regex patterns.\n- `TWEET_MAX_CHARS`: The character limit for hashtags (default is 280).\n\n## Creating a Standalone Executable\n\nTo create a standalone executable from the Python script using PyInstaller:\n\n1. Install PyInstaller:\n\n```bash\npip install pyinstaller\n```\n\n2. Navigate to the directory containing your script and run the following command:\n\n```bash\npyinstaller --onefile t3_scraper.py\n```\n\nThis will generate a standalone executable in the `dist` directory. You can run this executable without needing to install Python or any dependencies on the target machine.\n\n## Executing the Script\n\nOn Linux, ensure that the generated executable is set as executable by running:\n\n```bash\nchmod +x dist/t3_scraper dist/run_scraper.sh\n```\n\n**Running the Script**\n\nYou can run the script in two ways:\n\nOption 1: Right-click the `run_scraper.sh` file and select \"Run as a Program\" to execute it.\n\nOption 2: Using the Terminal\n\n- Open a terminal window.\n- Navigate to the directory where the `run_scraper.sh` file is located.\n- Run the following command:\n\n```bash\n./run_scraper.sh\n```\n\nThis will execute the scraper by launching the executable.\n\n## Notes\n\n- Ensure you have the Chrome WebDriver installed. You can use the WebDriver Manager to automatically handle this.\n- Adjust the sleep times if necessary based on your internet speed or website load time.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidbyte%2Ftwitter-trending-hashtags-scraper-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamidbyte%2Ftwitter-trending-hashtags-scraper-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidbyte%2Ftwitter-trending-hashtags-scraper-python/lists"}