GitXplorerGitXplorer
r

canada-vaccine-alerter

public
5 stars
0 forks
2 issues

Commits

List of commits on branch master.
Unverified
9ae9d8af5f333e3dd4d6b5026d16c27502e38ba7

Remvoed hamburger menu

rriyadparvez committed 4 years ago
Unverified
6df315988846922113eac54e50d3c28ae26cb8ae

Minor usability improvement

rriyadparvez committed 4 years ago
Unverified
e70f3355cf713845b49d838955a8c559a5a682cc

Improved logging

rriyadparvez committed 4 years ago
Unverified
e7a61085ff13f492e9e1439937a9c426342b2382

Adding support for other DB

rriyadparvez committed 4 years ago
Unverified
7be9b8e0fcccd7490e9b627b4f171d83af117ac7

Also add city based on FSA

rriyadparvez committed 4 years ago
Unverified
ee8767c58d337e761617a0c0caaf23df4d6f4881

Trying to debug city parsing issue

rriyadparvez committed 4 years ago

README

The README file for this repository.

Vaccine Updates

This the source code repo of vaccineupdates.ca site.

Getting Started

  • sqlite is used as database. This is the sql for tweet table
CREATE TABLE tweet (
	id INTEGER NOT NULL, 
	tweet_id INTEGER, 
	tweet_text VARCHAR, 
	province VARCHAR, 
	age_groups VARCHAR, 
	cities VARCHAR, 
	"FSAs" VARCHAR, 
	created_at DATETIME DEFAULT (CURRENT_TIMESTAMP), 
	ingested_at DATETIME DEFAULT (CURRENT_TIMESTAMP), 
	PRIMARY KEY (id), 
	UNIQUE (tweet_id)
);

It's also possible easily to switch to other databases. Plese see SqlAlchemy supported engines how to configure other databases.

  • litestream is used to back up sqlite db to s3. It's not necessary if you use other database.
  • Please create a config.yml similar to below
# For sqlite
SQLALCHEMY_DATABASE_URI = 'sqlite:////paths-to-db.sqlite'
# For postgres
# SQLALCHEMY_DATABASE_URI = 'postgresql://local_user:mysecretpassword@localhost:5432/local_database'

TWITTER_CONSUMER_KEY = ''
TWITTER_CONSUMER_SECRET = ''

TWITTER_ACCESS_TOKEN = ''
TWITTER_ACCESS_TOKEN_SECRET = ''

and fill up necessary secrets to run the app.

  • Build docker image: docker build -t vax-searcher .
  • Run the batch sync docker run vax-searcher python stream_sync.py -d 3. -d 3 means last three days tweets will be synced and processed.
  • Run the real-time sync docker run vax-searcher python batch_sync.py. This will use Twitter streaming API to sync Vaccine Hunters tweets in real-time.