Created
July 21, 2018 13:18
-
-
Save raelga/9a0e1e42596f770cc4ace7c888cda395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
date | |
function sendMessage { | |
MESSAGE=$@; | |
if [ "${MESSAGE}" != "" ]; | |
then | |
MESSAGE="Possible stock for SNES Mini:\n${MESSAGE}\n" | |
NOTIFY="@raelga @daninijmegen @marcotin @Whip1982 @pescadilla @yex_gr" | |
curl -sq -H "x-api-key: $BOTSKEY" -G "https://bots.rael.io/telegram/raelbot/mintiendo/" --data-urlencode "m=${NOTIFY} ${MESSAGE}" | |
NOTIFY="@raelga @daninijmegen" | |
curl -sq -H "x-api-key: $BOTSKEY" -G "https://bots.rael.io/telegram/raelbot/speak/-1001144327297/" --data-urlencode "m=${NOTIFY} ${MESSAGE}" | |
NOTIFY="@davidcafor @Augustuss @krystinuski" | |
curl -sq -H "x-api-key: $BOTSKEY" -G "https://bots.rael.io/telegram/raelbot/speak/-1001119976260/" --data-urlencode "m=${NOTIFY} ${MESSAGE}" | |
else | |
echo "Not yet." | |
fi | |
} | |
#GAME=$(curl -sq 'https://www.game.es/HARDWARE/CONSOLA/ELECTRONICA/NINTENDO-CLASSIC-MINI-SNES' | grep -A4 '<h3 class="title">' | egrep -i 'Nintendo.Classic.Mini' | sed 's@href="\(.*\)"@http://game.es\1@g' | sed 's/^\s*//g') | |
#if [ "${GAME}" != "" ]; | |
#then | |
# sendMessage "Game : ${GAME}"; | |
#fi | |
AMAZON=$(curl -sq --user-agent 'Mozilla' 'https://www.amazon.es/gp/product/B073DJ9T6K' | grep 'Añadir a la cesta') | |
if [ "${AMAZON}" != "" ]; | |
then | |
sendMessage "http://amzn.to/2t0q962"; | |
else | |
echo "Not yet." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment