MatsuTaku / notification-slack-atcoder-date

Notification AtCoder Date to Slack by Actions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notificate AtCoder Date to Slack (Beta Version)

This notifier tells your workspace contest date of AtCoder. In first setting, it send notification 1 and 24 hours before the contest.

Usage of GitHub Actions in this repo may be not recommended. So now, execution by schedule and pushing to master is stopped. If you use this repo or Actions used in this repo, please take responsibility for your actions.

Usage

Add Webhook App

(Note: I use Slack in Japan, so the text are Japanese. The following text may be different from the English version.)

First, add "Incoming Webhook" to your workspace.

Access https://(your workspace).slack.com/apps
-> Search "Incoming Webhook"
-> "Add to Slack"
-> Specify post channel and "add Incomming Webhook Integration"

In next page, note "Webhook URL". This is used later.

Fork This Repository

Fork this repo.
Next, add a new secret in settings tab. "Settings" -> "secrets" -> "Add a new secret"

Name: SLACK_URL
Value: ("Webhook URL" you noted.)

That's all you do.

I want to work just by foking. But it doesn't work. Currently adjusting.

How it works

Scraping

To get information of feature contests, Scraping is used by using ruby gem "Nokogiri". Target web site is AtCoder contests page.

Post to Slack

To send messages to Slack, "Incoming Webhook" is used. Thanks to this, we can send messages by using http requests. Messages are sent by granting the following json as request body.

{
    "text": "Hello Slack!"
}

"Incoming Webhook" can only send messages.

Regular Execution

Notification program are executed regularly. (every hour by default.) GitHub Actions is used for this. Scheduling is set to execute every hour at 0 minutes.

Features

It is much time to install gem "nokogiri". This gem is used every hours, so I want to use in one install. It is inefficient.

I look forward to your feedbacks !!

License

The MIT License 2019 EisKern

The full license is here.

Author

EisKern

About

Notification AtCoder Date to Slack by Actions

License:MIT License


Languages

Language:Ruby 100.0%