Skip to content

Commit

Permalink
Script to add jsk_fellows view
Browse files Browse the repository at this point in the history
Also apparently we don't need to install now, we get it already somehow.
  • Loading branch information
simonw committed Apr 19, 2020
1 parent 83fee2a commit e262204
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
}" > auth.json
- name: Create jsk.db using twitter-to-sqlite
run: twitter-to-sqlite lists jsk.db JSKstanford --members
- name: Create SQL view
run: ./create-view.sh
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Set up Zeit Now
run: yarn global add now
- name: Deploy Datasette using Zeit Now
env:
NOW_TOKEN: ${{ secrets.NOW_TOKEN }}
Expand Down
24 changes: 24 additions & 0 deletions create-view.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
sqlite3 jsk.db "create view jsk_fellows as
select
users.id,
users.name,
users.description,
users.location,
users.url,
'https://twitter.com/' || users.screen_name as twitter,
group_concat(lists.slug) as fellowship,
users.followers_count,
users.created_at,
users.verified,
users.screen_name
from users
join list_members
on list_members.user = users.id
join lists
on list_members.list = lists.id
where
lists.slug like 'jsk-fellows%'
and lists.slug not like '%projects'
group by users.id;"
sqlite3 jsk.db .schema

0 comments on commit e262204

Please sign in to comment.