about summary refs log tree commit diff stats
path: root/schema.sql
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-03-01 16:03:16 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-03-01 16:03:16 -0500
commit473b327ceed3afb5e5683002b39fd9c1947cb25a (patch)
tree0dd2eac68605ad8cf34a2e2e54c6a44ad3ab14c1 /schema.sql
parentd85fed8541a9580e820a907d83a2184b020572ba (diff)
downloadlunatic-473b327ceed3afb5e5683002b39fd9c1947cb25a.tar.gz
lunatic-473b327ceed3afb5e5683002b39fd9c1947cb25a.tar.bz2
lunatic-473b327ceed3afb5e5683002b39fd9c1947cb25a.zip
Redesigned persistent data formta
This is the start of a project to add imagery to the bot's output. We began by rewriting the scraper to use a SQLite datafile instead of dumping achievement names to a text file. This allows storage of additional information about each achievement, and allows for more sophisticated scraping.

Profiles to be scraped can be added on the command line using the scraper script, instead of being specified in a config file. The scraper can conduct full or delta scrapes; in a delta scrape, only each profile's recent games are scraped, whereas they are all scraped in a full scrape.

When a game is scraped for the first time, images from the store page of that game are saved locally to be used by the bot. The bot has been altered to not use Twitter, and instead generate a pixelated image based on an image from the game of the chosen achievement. This is just for development purposes. It also crashes occasionally due to picking an achievement from a game that does not have any images saved.

Sprites of the moons from Odyssey have been included in the repository. A short message denoting their copyright is included.
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql32
1 files changed, 32 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql new file mode 100644 index 0000000..61fdc45 --- /dev/null +++ b/schema.sql
@@ -0,0 +1,32 @@
1CREATE TABLE `profiles` (
2 `profile_id` INTEGER PRIMARY KEY,
3 `profile_path` VARCHAR(255) NOT NULL
4);
5
6CREATE UNIQUE INDEX `profile_by_path` ON `profiles`(`profile_path`);
7
8CREATE TABLE `games` (
9 `game_id` INTEGER PRIMARY KEY,
10 `steam_appid` INTEGER NOT NULL,
11 `moon_image` VARCHAR(255) NOT NULL
12);
13
14CREATE UNIQUE INDEX `game_by_appid` ON `games`(`steam_appid`);
15
16CREATE TABLE `achievements` (
17 `achievement_id` INTEGER PRIMARY KEY,
18 `game_id` INTEGER NOT NULL,
19 `title` VARCHAR(255) NOT NULL
20);
21
22CREATE TABLE `dids` (
23 `profile_id` INTEGER NOT NULL,
24 `achievement_id` INTEGER NOT NULL,
25 `achieved_at` DATETIME NOT NULL
26);
27
28CREATE TABLE `images` (
29 `image_id` INTEGER PRIMARY KEY,
30 `game_id` INTEGER NOT NULL,
31 `filename` VARCHAR(255) NOT NULL
32);