diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 35e37ee..a588000 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,7 +1,8 @@ name: QuotesBot on: schedule: - - cron: '35 */4 * * *' + # - cron: '35 */4 * * *' + - cron: '04 * * * *' jobs: deploy: runs-on: ubuntu-latest @@ -15,7 +16,7 @@ jobs: run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Run Script + - name: Run app.py run: python app.py env: diff --git a/app.py b/app.py index 9233f9d..33e2914 100644 --- a/app.py +++ b/app.py @@ -14,8 +14,8 @@ if source_object.reason == "OK": reader = csv.DictReader(io.StringIO(source_object.text)) source_data = dumps(list(reader)) choices = loads(source_data) - print(choices[0]) choice = choices[randint(0, len(choices) - 1)] headers = {'Authorization': 'Bearer ' + post_token} payload = {'status': f"{choice['quote']}\n\n - {choice['author']}\n\n#RandomQuote #quotes #quote #bot", 'visibility': 'public'} response = post(post_endpoint, headers=headers, data=payload) + print(response.reason, loads(response.text)['url'])