Get daily reminder about certain Nike shoes stock on Nike ID Store via Telegram Channel
- Install Python => 3.6
- Install dependencies
python3 -m pip install -r requirements.txt
- Create Telegram bot to get token. How?.
- Make new Telegram channel and add your bot to channel. How?
- Get your Telegram channel Chat ID. How?
- Get Service Account on GCP and save it as
client_secret.json
in this repo folder. How? - Enable Google Drive API and Sheet API for your project account on GCP. How?
- Create New Google Spreadsheet and delete all row except first one and then edit cell A1 and insert
--END--
. - Copy the
client_email
insideclient_secret.json
. Back in your spreadsheet, click the Share button in the top right, and paste theclient_email
value into the People field to give it edit rights. Hit Send. - Get
sheet_id
from spreadsheet that you already made before. How? - Open and change variable value in
_config.py
.
URL_SEARCH = 'https://www.nike.com/id/w/jordan-1-lifestyle-high-top-shoes-13jrmz4fokyz6lqy0zy7ok'
TELEGRAM_TOKEN = '<YOUR_TELEGRAM_BOT_TOKEN>'
TELEGRAM_CHAT_ID = <YOUR_TELEGRAM_CHANNEL_CHAT_ID> #integer
SHEET_ID = '<YOUR_SPREADSHEET_ID>'
TZ_NAME = '<YOUR_TIMEZONE>'
PROXY_HTTP = ''
PROXY_HTTPS = ''
PROXY_USER = ''
PROXY_PWD = ''
Edit this file with:
URL_SEARCH
: URL Search for any Nike shoes available on Nike Store Indonesia. You can change it with another shoes.TELEGRAM_TOKEN
: Your Telegram Bot TokenTELEGRAM_CHAT_ID
: Your Telegram Channel Chat IDSHEET_ID
: Your Spreadsheet IDTZ_NAME
: Your Timezone based on Olson's TZ Database Name
- Download this script using Terminal/Command Line.
# Clone
git clone https://github.com/alionar/nikeid-telegram-scrapper.git
cd nikeid-telegram-scrapper
- Use cron job on your Linux server or another job scheduller to run this command once a day.
python3 nikeid-telegram-scrapper.py
For example, i set up my crontab to run that command with this expression:
0 14 * * * python3 nikeid-telegram-scrapper.py
This command will be running everyday at 14:00 CEST (19:00 GMT+7, based on your server timezone)
- Profit.