CodeforLancaster / sitegeist

4 stars 1 forks source link

Tweet Summaries #7

Closed ryancallihan closed 5 years ago

ryancallihan commented 5 years ago

It would be useful to be able to see a summary of tweets throughout the day/week/month/etc.

Basically, there are a couples ideas:

Save top terms for the day:

text count total_sent type date avg_sent
#yeet 10 10.4 1 20190414 1.04

Save top tweets:

Save the highest weighted tweets from the day. This could also be done throughout the day. (Once an hour, for example)

wfaithfull commented 5 years ago

So this table will be keyed with a composite of [text, date]

CREATE TABLE top_terms (subject TEXT, count INTEGER, total_sent REAL, type INTEGER, date DATE, avg_sent REAL, PRIMARY KEY(subject, date))

wfaithfull commented 5 years ago

Also, this is probably best done using a SELECT INTO statement, if that's supported by SQLite. Otherwise, there's a whole unnecessary serialisation/deserialisation step into python objects and back. A timed job would only need to run once a day.