Last active
July 6, 2017 06:42
-
-
Save deguchi/38bcfeee526971c97f678a2c5d4a9111 to your computer and use it in GitHub Desktop.
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
| # -*- coding: utf-8 -*- | |
| import re | |
| import json | |
| import requests | |
| url = 'https://store.nintendo.co.jp/customize.html' | |
| content = requests.get(url).text | |
| if re.search(r'\bSOLD\s+OUT\b', content): | |
| print('Nintendo Switch SOLD OUT.') | |
| else: | |
| requests.post('SET-YOUR_SLACK-WEBHOOK-URL', data = json.dumps({ | |
| 'channel': u'発売', | |
| 'text': u"Hi, @deguchi. My Nintendo Store customization html has been changed.<%s>" % url, # 投稿するテキスト | |
| 'username': u'発売チェッカー', # 投稿のユーザー名 | |
| 'icon_emoji': u':ghost:', # 投稿のプロフィール画像に入れる絵文字 | |
| 'link_names': 1, # メンションを有効にする | |
| })) |
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
| requests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment