{"id":19055826,"url":"https://github.com/ehcaning/divar-telegram-bot","last_synced_at":"2025-04-24T04:27:50.352Z","repository":{"id":47733585,"uuid":"391865404","full_name":"ehcaning/divar-telegram-bot","owner":"ehcaning","description":"این ربات تلگرام هر موقعی که توی تاپیک مورد نظرتون آگهی جدیدی بیاد، بهتون توی تلگرام اطلاع میده","archived":false,"fork":false,"pushed_at":"2024-01-30T01:03:11.000Z","size":129,"stargazers_count":99,"open_issues_count":4,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T12:19:14.342Z","etag":null,"topics":["bot","divar","telegram","telegram-bot"],"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/ehcaning.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}},"created_at":"2021-08-02T08:13:37.000Z","updated_at":"2025-04-14T06:38:38.000Z","dependencies_parsed_at":"2025-04-17T23:50:13.276Z","dependency_job_id":null,"html_url":"https://github.com/ehcaning/divar-telegram-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fdivar-telegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fdivar-telegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fdivar-telegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fdivar-telegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehcaning","download_url":"https://codeload.github.com/ehcaning/divar-telegram-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250563029,"owners_count":21450767,"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","divar","telegram","telegram-bot"],"created_at":"2024-11-08T23:47:08.868Z","updated_at":"2025-04-24T04:27:50.322Z","avatar_url":"https://github.com/ehcaning.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Divar Telegram Bot\n\n1- Open `@BotFather` in Telegram.\n2- Create a new bot and copy bot token. (Or use existing bot and copy bot token)\n```python\nBOT_TOKEN = '\u003cBOT-TOKEN-HERE\u003e'\n```\n3- Send a message to `@getidsbot` and response should be something like this:\n```text\n👤 You\n ├ id: 00000000\n ├ is_bot: false\n ├ first_name: Ehsan\n ├ last_name: Seyedi\n ├ username: _ (https://t.me/_)\n ├ language_code: en (-)\n └ created: ~ 2/2014 (?) (https://t.me/getidsbot?start=idhelp)\n```\nCopy `id` and paste here:\n```python\nBOT_CHATID = '\u003cCHAT-ID-HERE\u003e'\n```\n\n4- Open your new (or old) bot (from step 2) and press `Start` (So bot can send you messages).\n\n5- Go to https://divar.ir/, select your city and go to desired category. Choose some search conditions like this:\n\n![Divar Search](img/search.png)\n\nWeb browser's URL should be something like this:\n```url\nhttps://divar.ir/s/mashhad/rent-residential/janbaz?districts=1124%2C442\u0026credit=-100000000\u0026rent=-3000000\u0026size=-90\n```\nCopy everything after `https://divar.ir/s/`, in this case it will be `mashhad/rent-residential/janbaz?districts=1124%2C442\u0026credit=-100000000\u0026rent=-3000000\u0026size=-90`\n\nAnd paste this here:\n\n```python\nURL = \"https://api.divar.ir/v8/web-search/\u003cSEARCH-CONDITIONS-HERE\u003e\"\n```\n\n6- SSH to your server and make a cronjob to execute this code in which frequency you want.\n\n```bash\ncrontab -e\n```\n\n```crontab\n*/2 * * * * cd /root/divar_bot; /usr/bin/python3.8 main.py \u003e\u003e /dev/null 2\u003e\u00261\n```\n* In this example, repository is in `/root/divar_bot` directory\n* This code will run every 2 minutes, if you need any help visit https://crontab.guru/\n\n## Final Result:\n![Telegram Messages](img/preview.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehcaning%2Fdivar-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehcaning%2Fdivar-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehcaning%2Fdivar-telegram-bot/lists"}