Created
April 22, 2016 18:29
-
-
Save unRob/d2dde427fc1a5fd052d138ecba70fe34 to your computer and use it in GitHub Desktop.
Slack notification on domain available
This file contains hidden or 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/sh | |
export LIST="https://www.registry.mx/report/domain_deleted_list.xml" | |
export DOMAIN="SOMEDOMAIN.mx" | |
export HOOK="https://hooks.slack.com/services/SOME/TOKENS" | |
export PAYLOAD='payload={"channel": "#CHANNEL", "username": "domainbot", "text": "@here SOMEDOMAIN.mx disponible en <https://akky.mx|el peor registrar de la historia>", "icon_emoji": ":ghost:"}' | |
echo "Buscando $(date '+%Y-%m-%d %H:%M:%S')" | |
curl --silent $LIST | grep $DOMAIN && curl -XPOST --data-urlencode $PAYLOAD $HOOK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment