Skip to content

Instantly share code, notes, and snippets.

@unRob
Created April 22, 2016 18:29
Show Gist options
  • Save unRob/d2dde427fc1a5fd052d138ecba70fe34 to your computer and use it in GitHub Desktop.
Save unRob/d2dde427fc1a5fd052d138ecba70fe34 to your computer and use it in GitHub Desktop.
Slack notification on domain available
#!/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