nogisched

package module
v0.0.0-...-ae20a06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 11 Imported by: 0

README

nogisched

乃木坂46の公式サイトのスケジュールをスクレピングして,標準出力へ出力するCLI.

動的サイトのスクレイピング用のライブラリとしてchromedpを使用しているため,Google Chromeまたはchromium-browser等が必要.

usage:

./nogisched -d 20220601 -notify

options:

name 説明 デフォルト値
d スケージュールを取得したい日付のyyyyMMdd形式(e.g. 20220605)) 端末の実行時の日付
notify LINE Notifyを使って通知するか(通知する場合は後述の環境変数が必要) false

出力形式

05 Sun
ラジオ 18:00〜18:30 文化放送「乃木坂46の「の」」筒井あやめ
TV 24:00〜24:30 テレビ東京系「乃木坂工事中」

LINE Notifyで通知を行う場合は使用するトークンを環境変数 NOGISCHED_NOTIFY_TOKEN にLINE Notifyのトークンを設定する.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(ctx context.Context, ym string) (string, error)

Fetchはブラウザを立ち上げ乃木坂のサイトから指定の年月のスケジュールのHTMLを取得する

func Notify

func Notify(msg string) (string, error)

Types

type Appearance

type Appearance struct {
	Category string
	Time     string
	Title    string
}

func (Appearance) String

func (a Appearance) String() string

type Schedule

type Schedule struct {
	Date        string
	Appearances []Appearance
}

func Scrape

func Scrape(html string) ([]Schedule, error)

Scrapeは与えられた乃木坂の予定のHTMLを使ってスクレイピングを実行

func (Schedule) String

func (s Schedule) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL