Upgrade to Pro — share decks privately, control downloads, hide ads and more …

(俺的)超絶便利な自作ツールたちの紹介タイム

Avatar for Kotaro Inoue Kotaro Inoue
March 22, 2025
7

 (俺的)超絶便利な自作ツールたちの紹介タイム

2025/03/22 @ 情報科学若手の会 春の陣2025 #wakate2025s

Avatar for Kotaro Inoue

Kotaro Inoue

March 22, 2025
Tweet

Transcript

  1. rarejobctl: CLIの実装手順 1. 気合いを入れる 2. Chrome DevToolsを使ってレアジョブの予約導線上に存在する関連要素のセレクタを収 集 3. GoのSelenium

    WebDriver Client実装の tebeka/selenium を使って予約処理を実装 4. ついでにDiscord/Slack通知を実装 5. 完成
  2. rarejobctl: 定期実行→GitHub Actions GitHub Actionsは、 schedule トリガーを用いて定期実行が可能 name: Reserve next

    daily lesson on: schedule: - cron: "0 11 * * 0,1,2,3,4" # 日〜木曜日の20 時(JST) に実行、つまり平日のレッスンを各前日に予約 workflow_dispatch: jobs: reserve: runs-on: ubuntu-latest services: selenium: image: selenium/standalone-firefox-debug:3.141 container: image: ghcr.io/musaprg/rarejobctl:latest env: # ... steps: # ... - name: Reserve a next lesson env: TZ: "Asia/Tokyo" # Timezone is set to JST run: |
  3. 監視と通知 Grafana Cloudで監視 放送開始の3日前になっても、登録した録画ルールに番組が1件もマッチしない場合にア ラートを出す sum by (annict_work_id) ( (epgstation_rule_reserves

    == bool 0 == 1) * on(rule_id) group_right annict_epgstation_connector_syncer_recording_rule_synced ) * on(annict_work_id) group_right label_replace( annict_epgstation_connector_syncer_annict_work_started_at - time() > 0, "annict_work_id", "$1", "id", "(.*)" ) / 60 / 60 / 24
  4. Q&A