victorakaps / Amazon-Flipkart-Price-Drop-Alert

A telegram bot which sends you a email and message on telegram if your registered product meets any set threshold price drop.
26 stars 13 forks source link

can you write a better read me for installation ? #1

Closed rsoorajs closed 3 years ago

rsoorajs commented 3 years ago

can you write a better read me for installation ?

victorakaps commented 3 years ago

yes, i can walk you through the whole installation and initiation process, all you need to do it install dependencies and place your bot token, i am not currently hosting it anywhere, but if you want demo let me know i will host it locally for time you have check out.

victorakaps commented 3 years ago

and you have to replace SENDER_EMAIL and SENDER_PASS with your email credentials from which you want to send notifications, you can change the ping time, in cronjob function currently it is set to 30 minutes, so this bot check's price every 30 minutes, you can change it as per your need.

rsoorajs commented 3 years ago

and you have to replace SENDER_EMAIL and SENDER_PASS with your email credentials from which you want to send notifications, you can change the ping time, in cronjob function currently it is set to 30 minutes, so this bot check's price every 30 minutes, you can change it as per your need.

Do you mean here i have to replace my email id and password like in this picture ? what about bot token ? putting all them in a '.env' and using dotenv module is much easier,now its look complicated unless you help me.

Also need a feature,

we have to recieve alert on any price drop.yeah we want both

can you add that option too ?

also another doubht,how the bot can remember schedulding,because it doesnt seems like it is using a DATABASE.so how its even possible?

IMG_20200930_073748_583

victorakaps commented 3 years ago

that's the thing, the bot has to be hosted 24/7, so data is being saved in same instance and will stay as long as the bot stay's up. and the thing about environment variable, there are only three here, BOT_TOKEN, SENDER_MAIL and SENDER_PASS, you can directly replace them in bot file or choose to make these variables as process.env.BOT_TOKEN, process.env.SENDER_MAIL and process.env.SENDER_PASS and then put them in env file. so just make these three variables just below where we are importing dependencies like const BOT_TOKEN = "****" const SENDER_EMAIL = "example@xyz.com" const SENDER_PASS = "!23@as"

rsoorajs commented 3 years ago

IMG_20200930_191254_364

right ?

rsoorajs commented 3 years ago

Also add a feature i you can

we have to recieve alert on any price drop

Thats cool ? like if i set the price drop alert fotr 200 and the price drop was 205 ,i would really affordable to go for that.but due to specific price setting i missed that deal.so you got my logic ? if you can add this too brother

victorakaps commented 3 years ago

move const bot = new Telegraf.... line below these variables and yes i can add that feature but currently not planning on acting it out, maybe in near future.

victorakaps commented 3 years ago

you can achieve this with little adjustment like you said if threshold price is 200 and deals comes for 205, so thats what 2.5 percent more than the set price, so you can add another or expression in condition and adjust that varying percentage.

rsoorajs commented 3 years ago

you can achieve this with little adjustment like you said if threshold price is 200 and deals comes for 205, so thats what 2.5 percent more than the set price, so you can add another or expression in condition and adjust that varying percentage.

yeah i got your point.so how to remove the alerts once i had bought the product ? or just onetime alert ?

victorakaps commented 3 years ago

actually i didn't thought about that earlier, but what we have to do is just pop that task just after sending notification. try to get it work if it happens then good else i will do it at my earliest ease.

rsoorajs commented 3 years ago

Thank you.try to add remove option for stopping alerts,else it may be annoying for users.anyway i hope you will implement anyprice drop alert option in future.anyway,its the simple and amazing code you written.keep coding :)

victorakaps commented 3 years ago

thank you, now i'm seeing potential in this bot, so i will add all the features you mentioned and will connect it to db.

rsoorajs commented 3 years ago

also i pushed some fixes in your code(to fix installing dependencies,else you may get error)

hope you can see that in the pull requests.

victorakaps commented 3 years ago

yes i saw it, i might have actually merge it with main branch, but now that i will be adding more features to the og, so i think it's not necessary, expect the update in next week or so, cheers mate

rsoorajs commented 3 years ago

thank you, now i'm seeing potential in this bot, so i will add all the features you mentioned and will connect it to db.

if you implemented DB ,we can deploy the bot on Heroku and lots of benifits like,if the bot accidently stopped,we will never lose our users data.I think mongodb is easy,else go for postgres. And use it like...

MONGODB_URI=xxxxxxxxxx

i was planned to deploy the bot on heroku,then i got that,the code didnt use dbs,so it cant store data in heroku permanently without having an external database for free users(mongo is best).

your code is worthy bro.make it in fine shape.

victorakaps commented 3 years ago

yes, we will work with mongodb, and it has some other minor issues like if a product is on deal of the day category then class to target is not same, so will have to take care of many minor things like that, it's only that i am slightly busy this week, but i look forward to work on this with you. perhaps next week. drop down a msg to @victorakaps on tg and we will proceed.

rsoorajs commented 3 years ago

yes, we will work with mongodb, and it has some other minor issues like if a product is on deal of the day category then class to target is not same, so will have to take care of many minor things like that, it's only that i am slightly busy this week, but i look forward to work on this with you. perhaps next week. drop down a msg to @victorakaps on tg and we will proceed.

texted you on Telegram

victorakaps commented 3 years ago

yes, we will work with mongodb, and it has some other minor issues like if a product is on deal of the day category then class to target is not same, so will have to take care of many minor things like that, it's only that i am slightly busy this week, but i look forward to work on this with you. perhaps next week. drop down a msg to @victorakaps on tg and we will proceed.

texted you on Telegram

so i added any price drop command and also we are now removing task just after we send notification, so that it doesn't repeat, but i haven't connected it to any db yet. let me know if you are seeking anyother changes

rsoorajs commented 3 years ago

yes, we will work with mongodb, and it has some other minor issues like if a product is on deal of the day category then class to target is not same, so will have to take care of many minor things like that, it's only that i am slightly busy this week, but i look forward to work on this with you. perhaps next week. drop down a msg to @victorakaps on tg and we will proceed.

texted you on Telegram

so i added any price drop command and also we are now removing task just after we send notification, so that it doesn't repeat, but i haven't connected it to any db yet. let me know if you are seeking anyother changes

yup i saw your recent pushes.thanks for that 😍 everything is looks fine except one,why dont you add an option for stop alerts ,instead stopping alerts after one alert ? if the user didnt want to go for the current drop ,he would like to wait for another drop.so he have re-add again and again.that will disgust him.

instead of that if you add a stop alert function manually,he can stop alerts when ever he want,or he can continue as long as he wants.hope you understand.

if you connected to the db,may be that was too easy,like just adding and removing product from the db will manage that part.if the product stays in the db,he will get alerts,if we delete that from db,we will not get alerts.something like that.

just a suggetion.anyway thank you for your all efforts :)

rsoorajs commented 3 years ago

Any other email providers supported right now along with gmail ? because if we publish this bot,there is a limitation lying in gmail.we can only send 100 emails/day.what we got 10000 users/day ?

i also dont have a solution for this,have to find an unlimited email sending provider or something.This is not a bug,its a limitation 😢

victorakaps commented 3 years ago

yes, we will work with mongodb, and it has some other minor issues like if a product is on deal of the day category then class to target is not same, so will have to take care of many minor things like that, it's only that i am slightly busy this week, but i look forward to work on this with you. perhaps next week. drop down a msg to @victorakaps on tg and we will proceed.

texted you on Telegram

so i added any price drop command and also we are now removing task just after we send notification, so that it doesn't repeat, but i haven't connected it to any db yet. let me know if you are seeking anyother changes

yup i saw your recent pushes.thanks for that 😍 everything is looks fine except one,why dont you add an option for stop alerts ,instead stopping alerts after one alert ? if the user didnt want to go for the current drop ,he would like to wait for another drop.so he have re-add again and again.that will disgust him.

instead of that if you add a stop alert function manually,he can stop alerts when ever he want,or he can continue as long as he wants.hope you understand.

if you connected to the db,may be that was too easy,like just adding and removing product from the db will manage that part.if the product stays in the db,he will get alerts,if we delete that from db,we will not get alerts.something like that.

just a suggetion.anyway thank you for your all efforts :)

added kick command for it, it can be used to pause or resume notifications, now just have to figure out db. and about nodemailer alternative i would look into that.

rsoorajs commented 3 years ago

Thank you bro.Let me try your updated repo

victorakaps commented 3 years ago

Thank you bro.Let me try your updated repo

Now bot is saving and retrieving from sessions. firstly thought of using db like mongoose but for that i would have to restructure pretty much everything, so felt like overkill to me, given that current saving hack will do work just fine. So that's pretty much all i had for this particular bot for now. do tell me if it can be improved in anyway.

rsoorajs commented 3 years ago

Thank you bro.Let me try your updated repo

Now bot is saving and retrieving from sessions. firstly thought of using db like mongoose but for that i would have to restructure pretty much everything, so felt like overkill to me, given data current saving hack will do the work just fine. So that's pretty much all i had for this particular bot for now. do tell me if it can be improved in anyway.

let me test.could you please ping me on telegram id which i gave you ?