[PYTHON] Web scraping of comedy program information and notification on LINE

background

スクリーンショット 2019-12-17 15.24.37.png

There are so many specials for comedy shows! However, because it is a special program, it is broadcast suddenly, so it is easy to miss it.

Since we are recording on the HDD, there is no function that automatically records the comedy genre.

When I missed my favorite comedy show, I was just sad ...

Here is what I made there!

IMG_3682.jpg

Comedy information comes to me every morning at 6 o'clock. Now you won't miss a prize race or special.

Source code

It is open source. https://github.com/souring001/owarai-info

It can be used not only on LINE but also on Slack.

Web scraping

I decided to get information from the comedy genre of G Guide TV Kingdom.

notification

I am notified by running the program every morning at 6 o'clock from my Raspberry Pi at home.

Notify by LINE

If you issue a token with LINE Notify, you can be notified with the following code. Enter the message you want to send in message.

line_notify_url = 'https://notify-api.line.me/api/notify'
line_notify_token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

headers = {"Authorization" : "Bearer "+ line_notify_token}
payload = {'message' :  message}

r = requests.post(line_notify_url, headers=headers, params=payload)

Notify with Slack

By using Slack's Incoming Webhook, you can be notified with the following code. Put the message you want to send in text.

slack_url = 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
slack = slackweb.Slack(url=slack_url)

slack.notify(text=text, username='owarai-info')

problem

At the end

I'm looking forward to this year's M-1! It's from 6:34 pm on Sunday, December 22nd! !! !! (The sound of SECCON and exploding)

Recommended Posts

Web scraping of comedy program information and notification on LINE
Slack notification of weather information on OpenWhisk
Web scraping technology and concerns
Automation of a research on geographical information such as store network using Python and Web API
[Python] LINE notification of the latest information using Twitter automatic search
Scraping news of incidents on livedoor
Notify LINE of train operation information
Beginners use Python for web scraping (4) -3 GCE VM instance creation and scraping on VM
Summarize the titles of Hottentori at the end and look at the present on the Web
Get delay information on Twitter and tweet
See file and folder information on python
Practice web scraping with Python and Selenium
Easy web scraping with Python and Ruby
Scraping the rainfall data of the Japan Meteorological Agency and displaying it on M5Stack
Scraping data wrangling of statistical information on new coronavirus infection in Yamanashi Prefecture
LINE Bot sent me the scraping results of IT trend information [LINE Messaging API]