Skip to content

Poll the emojitracker REST API to collect hourly historical data.

Notifications You must be signed in to change notification settings

tomshafer/emojitracker-history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emojitracker Historical Data

Poll the emojitracker REST API hourly to collect updated emoji counts.

Usage

$ python ./emojihistory.py -v emoji.db
[2020-08-31 18:54:07 EDT] INFO - Opened database connection to "emoji.db"
[2020-08-31 18:54:07 EDT] INFO - Database is fresh, creating tables
[2020-08-31 18:54:08 EDT] INFO - Updated emoji in 0.00322 s
[2020-08-31 18:54:08 EDT] INFO - Inserted counts in 0.00255 s
[2020-08-31 18:54:08 EDT] INFO - Closed database connection

Schema

CREATE TABLE emoji (
    id TEXT NOT NULL PRIMARY KEY,
    char TEXT NOT NULL,
    name TEXT NOT NULL,
    updated INTEGER DEFAULT(DATETIME('now'))
);

CREATE TABLE counts (
    id TEXT NOT NULL,
    date INTEGER NOT NULL DEFAULT(DATETIME('now')),
    count INTEGER NOT NULL,
    PRIMARY KEY(id, date)
);