aboutsummaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rwxr-xr-xsources/projects/import.rb2
-rwxr-xr-xsources/projects/parse.rb4
-rw-r--r--sources/projects/pre.sql2
3 files changed, 4 insertions, 4 deletions
diff --git a/sources/projects/import.rb b/sources/projects/import.rb
index 4004892..f128281 100755
--- a/sources/projects/import.rb
+++ b/sources/projects/import.rb
@@ -61,7 +61,7 @@ projects.each do |id, url|
rescue
last_modified = Time.now.utc
end
- db.execute("INSERT INTO projects (id, json_url, last_modified, fetch_date, fetch_status, fetch_json, fetch_result, data_updated) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
+ db.execute("INSERT INTO projects (id, json_url, last_modified, fetch_date, fetch_status, fetch_json, status, data_updated) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
id,
url,
last_modified,
diff --git a/sources/projects/parse.rb b/sources/projects/parse.rb
index 1471d0e..679d9de 100755
--- a/sources/projects/parse.rb
+++ b/sources/projects/parse.rb
@@ -36,7 +36,7 @@ db = SQLite3::Database.new(dir + '/taginfo-projects.db')
#------------------------------------------------------------------------------
-projects = db.execute("SELECT id, fetch_json FROM projects WHERE fetch_result='OK' ORDER BY id")
+projects = db.execute("SELECT id, fetch_json FROM projects WHERE status='OK' ORDER BY id")
projects.each do |id, json|
puts " #{id}..."
@@ -89,7 +89,7 @@ projects.each do |id, json|
end
end
rescue JSON::ParserError
- db.execute("UPDATE projects SET fetch_result='PARSE_ERROR' WHERE id=?", id)
+ db.execute("UPDATE projects SET status='PARSE_ERROR' WHERE id=?", id)
end
end
diff --git a/sources/projects/pre.sql b/sources/projects/pre.sql
index 6e4c0de..ae55fbf 100644
--- a/sources/projects/pre.sql
+++ b/sources/projects/pre.sql
@@ -17,7 +17,7 @@ CREATE TABLE projects (
fetch_date DATE,
fetch_status TEXT, -- HTTP status code
fetch_json TEXT, -- HTTP body
- fetch_result TEXT, -- 'OK', 'FETCH ERROR', 'PARSE ERROR'
+ status TEXT, -- 'OK', 'FETCH ERROR', 'PARSE ERROR'
data_format INTEGER,
data_updated DATE,
data_url TEXT,