Add instructions for creating HPR SQLite file

This commit is contained in:
Roan Horning 2023-03-07 19:06:29 -05:00
parent 7feae31e11
commit b420453abd
Signed by: rho_n
GPG Key ID: 234AEF20B72D5769

View File

@ -51,7 +51,41 @@ cpan Date::Calc
cpan Tie::DBI
```
# Create the HPR database
The hpr_generator relies on information from a database to generate many of the
files for the website (for example: index.html, series/index.html,
hpr_mp3.rss, etc). This data is available from a MySQL dump file found on
hackerpublicradio.org at "https://www.hackerpublicradio.org/hpr.sql".
The first step is to download the hpr.sql file. This can be done using your
browser, or by running one of the following commands:
`curl https://www.hackerpublicradio.org/hpr.sql --output ./hpr.sql`
or
`wget --directory-prefix=./ https://www.hackerpublicradio.org/hpr.sql`
## Creating an SQLite database file
The SQL of the hpr.sql file must be converted from MySQL specific statements to
SQLite specific statements. The mysql2sqlite script found in the utils directory
is used for this conversion. First remove the lines from hpr.sql that
mysql2sqlite can't handle:
`sed '/^DELIMITER ;;/,/^DELIMITER ;/d' < ./hpr.sql > ./hpr-sqlite.sql`
Next run the mysql2sqlite script piping its output into the sqlite3
program which creates the hpr.db file:
`./utils/mysql2sqlite ./hpr-sqlite.sql | sqlite3 ./hpr.db`
For convenience, the update-sqlite-db.sh script in the utils directory
automates the above steps (including downloading the hpr.sql file).
From the root of the local hpr_generator repository run:
`./utils/update-sqlite-db.sh`
# Configure site-generator
# Run site-generator