With this telegram bot you can monitor price of any Flipkart product. This TG bot is heroku based. Now before you continue i recommend you to read Note section.
- Create account on GitHub (if you haven't).
- Create account on Heroku (if you haven't).
- Create account on Telegram (if you haven't).
- Create account on Gmail (if you haven't for only this script).
- Go to my.telegram.org/auth, login and create app. Check how to create app on telegram. Now save api_id and api_hash which you got from my.telegram.org/auth.
- Create a telegram bot by using Bot Father. Check how to create bot in telegram. Bot Father will give you bot token save that token.
- Allow less secure apps to access to your above created gmail account.
- So now you have saved four things:-
- api_id
- api_hash
- bot_token
- gmail credentials
-
Just git clone this repository and start working by editing the code.
git clone https://github.com/whitehatjrchintu/flipkartpricechecker.git
cd flipkartpricechecker
-
Or download this repository as zip.
-
After cd or unzip you have to edit bot.py file.
-
In bot.py teri_chat_id_daal this mentioned two times. You have to replace this with your chat id. Search @chatid_echo_bot in telegram (This bot is not mine. You can google how to get chat id in telegram.) and click start this will give you your chat id. Now replace teri_chat_id_daal with your chat id number.
-
Enter gmail credentials in line 40, enter sender email,receiver email in line line 44.
-
Make other changes like url,subject etc. at your own if you want to change.
- Now create repository (you can create private repository too.) in your github account and upload all 5 files.
-
Copy your github repository's link and paste after ?template= in this link
https://www.heroku.com/deploy/?template=
. Like this:-https://www.heroku.com/deploy/?template=https://github.com/whitehatjrchintu/flipkartpricechecker
- Now enter App name in app_name and api_id,api_hash and bot_token which you saved in above steps, in respective asked field. Then click Deploy app.
- Your app now created. Go to your app settings. Here
https://dashboard.heroku.com/apps/your_heroku_app/settings
,click on add buildpack and add following 2 links one by one.
https://github.com/heroku/heroku-buildpack-chromedriver
https://github.com/heroku/heroku-buildpack-google-chrome
- Now go here dashboard.heroku.com/apps/your_heroku_app/deploy/github, click on Deployment method and connect your github account. Under Search for a repository to connect to enter your created repository's name (which you created at step3) and connect your repository. Then click deploy branch under Manual deploy section.
- Finally go to your bot,click start button you will get notification exactly after 30 minutes.
- Replace your product url in bot.py.
- Do as per steps.
- I know there is some extra steps in it. I have to write this for noobs.
- Will improve it timely. If you found any mistake or have any suggestion let me know i will correct/apply that.
- Meant for educational purpose only. I am not responsible if telegram block your account.
- Added smtp for sending emails if price decreases at a particular mentioned level. (19-11-2020)