Coder Social home page Coder Social logo

cancelchecker's Introduction

cancelChcker

学内サイトの休講情報をスクレイピングしてTwitterに投げる。

使い方

パッケージを導入

$ python3 -m venv env
$ . env/bin/activate
$ pip install -r requirements.txt

クレデンシャルの取得

GoogleカレンダーAPIのcredentialを取得する。

https://console.developers.google.com/apis/credentials

プロジェクトの選択→クライアントIDを選択→JSONをダウンロード→ credential.json として保存

認証の取得

$ python calAdd.py --noauth_local_webserver

ブラウザに表示された認証コードをターミナルに貼り付ける。

実行

走らせる。

$ python main.py

Cronに登録する場合は以下のようにCronを登録する。

#!/bin/bash -xe

cd /home/foo/cancelChecker
. env/bin/activate
python main.py
$ crontab -e
*/5 * * * *  /bin/bash /home/foo/run.sh                                          

概要

  1. bs4で学内サイトをスクレピング
  2. 取得したデータを解析して過去のデータと比較
  3. 新たなデータのみを取り出してTwitterに投稿

Note

Googleカレンダの扱い: https://gist.github.com/tomoyk/a46b2e181ff76a82fddf45566d68a9f0

cancelchecker's People

Contributors

dependabot[bot] avatar panakuma avatar tomoyk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

panakuma

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.