aboutsummaryrefslogtreecommitdiff
path: root/sources/wiki
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-11-13 21:31:39 +0100
committerJochen Topf <jochen@topf.org>2010-11-13 21:31:39 +0100
commit9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d (patch)
tree0d2ae6de413c39c21d30aaf296a98ee37977ab45 /sources/wiki
parentc82bbe69572398d44187ca7b57b1ce572f435d65 (diff)
downloadtaginfo-9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d.tar
taginfo-9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d.tar.gz
Multiple changes
* Improved and cleaned up source import scripts * Improved some reports and report overview * New osmium version that uses a better hash function * Some experimental magic to include Javascipt in an easier way (tested in keys.erb)
Diffstat (limited to 'sources/wiki')
-rw-r--r--sources/wiki/post.sql2
-rw-r--r--sources/wiki/pre.sql19
-rwxr-xr-xsources/wiki/update.sh17
3 files changed, 13 insertions, 25 deletions
diff --git a/sources/wiki/post.sql b/sources/wiki/post.sql
index eaf9ec0..773a04d 100644
--- a/sources/wiki/post.sql
+++ b/sources/wiki/post.sql
@@ -36,5 +36,5 @@ INSERT INTO stats (key, value) SELECT 'wiki_languages', count(*) FROM wiki_langu
ANALYZE;
-UPDATE meta SET update_end=datetime('now');
+UPDATE source SET update_end=datetime('now');
diff --git a/sources/wiki/pre.sql b/sources/wiki/pre.sql
index 0e8200e..56e9538 100644
--- a/sources/wiki/pre.sql
+++ b/sources/wiki/pre.sql
@@ -6,24 +6,7 @@
.bail ON
-DROP TABLE IF EXISTS meta;
-
-CREATE TABLE meta (
- source_id TEXT,
- source_name TEXT,
- update_start TEXT,
- update_end TEXT,
- data_until TEXT
-);
-
-INSERT INTO meta (source_id, source_name, update_start, data_until) SELECT 'wiki', 'Wiki', datetime('now'), datetime('now');
-
-DROP TABLE IF EXISTS stats;
-
-CREATE TABLE stats (
- key TEXT,
- value INT64
-);
+INSERT INTO source (id, name, update_start, data_until) SELECT 'wiki', 'Wiki', datetime('now'), datetime('now');
DROP TABLE IF EXISTS wikipages;
diff --git a/sources/wiki/update.sh b/sources/wiki/update.sh
index b6f63a6..7d7dc6b 100755
--- a/sources/wiki/update.sh
+++ b/sources/wiki/update.sh
@@ -9,12 +9,14 @@ set -e
DIR=$1
+DATECMD='date +%Y-%m-%dT%H:%M:%S'
+
if [ "x" = "x$DIR" ]; then
echo "Usage: update.sh DIR"
exit 1
fi
-echo -n "Start wiki: "; date
+echo "`$DATECMD` Start wiki..."
DATABASE=$DIR/taginfo-wiki.db
LOGFILE=$DIR/get_wiki_data.log
@@ -24,17 +26,20 @@ rm -f $DIR/tagpages.list
rm -f $LOGFILE
rm -f $DATABASE
-echo "Running pre.sql..."
+echo "`$DATECMD` Running init.sql..."
+sqlite3 $DATABASE <../init.sql
+
+echo "`$DATECMD` Running pre.sql..."
sqlite3 $DATABASE <pre.sql
-echo "Getting page list..."
+echo "`$DATECMD` Getting page list..."
./get_page_list.rb $DIR
-echo "Getting wiki data..."
+echo "`$DATECMD` Getting wiki data..."
./get_wiki_data.rb $DIR >$LOGFILE
-echo "Running post.sql..."
+echo "`$DATECMD` Running post.sql..."
sqlite3 $DATABASE <post.sql
-echo -n "Done wiki: "; date
+echo "`$DATECMD` Done wiki."