feat: add new twitter workflow (#185)

This commit is contained in:
Guido García 2021-03-06 15:05:56 +01:00 committed by GitHub
parent 303e2a08ed
commit 050c6b244b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

28
.github/workflows/twitter.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: analyze
on:
schedule:
- cron: "0 4 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install dependencies
run: npm ci
- name: Request Twitter stats
env:
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }}
run: npm run twitter:search

3
crawler/twitter.js Normal file
View File

@ -0,0 +1,3 @@
// TODO
console.log(process.env.TWITTER_API_KEY);

View File

@ -11,6 +11,7 @@
"crawl:analyze": "node crawler/analyze.js",
"crawl:results": "node crawler/results.js",
"crawl": "npm run crawl:analyze && sleep 60 && npm run crawl:results",
"twitter:search": "node crawler/twitter.js",
"test": "ava"
},
"repository": {