herokuでtwitter botを定時実行

pipenv install python-twitter
pipenv install html5lib
pipenv install beautifulsoup4
pipenv install apscheduler
pipenv install requests

pipenv run pip freeze > requirements.txt
echo "python-3.6.7" > runtime.txt
echo "clock: python clock.py" > Procfile

git config --global user.name "xxxxx"
git config --global user.email "xxxxx@gmail.com"

rm -rf .git

git init
git add .
git commit -m "my first commit"

heroku create xxxxx

git push heroku master

clock.py

from apscheduler.schedulers.blocking import BlockingScheduler
import os

sched = BlockingScheduler()

# 30分毎
# @sched.scheduled_job('interval', minutes=30)
# 1時間毎
# @sched.scheduled_job('interval', hours=1)

# 定時
@sched.scheduled_job('cron', minute=00, hour=7)
def dam_job():

    os.system('python tamagawa-dam.py')


@sched.scheduled_job('cron', minute=30, hour=7)
def hospital_job():

    os.system('python today-hospital.py')

sched.start()
sudo snap install --classic heroku

heroku login -i

heroku git:clone -a xxxxx

git init
git add .
git commit -m "my first commit"
git push heroku master

heroku logout