aboutsummaryrefslogtreecommitdiff
path: root/sources/wiki
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-11 10:04:44 +0100
committerJochen Topf <jochen@topf.org>2013-01-11 10:04:44 +0100
commit61b0fe938df7d8ddf65671222ac618a637059460 (patch)
treed77ee6ca964024abb7c5ad374920791c61735d69 /sources/wiki
parent34fbbac684e0636c06442760f1d3b409959ec52a (diff)
downloadtaginfo-61b0fe938df7d8ddf65671222ac618a637059460.tar
taginfo-61b0fe938df7d8ddf65671222ac618a637059460.tar.gz
Consolidate user-agent setting in mediawiki lib
Diffstat (limited to 'sources/wiki')
-rwxr-xr-xsources/wiki/get_image_info.rb1
-rwxr-xr-xsources/wiki/get_page_list.rb1
-rwxr-xr-xsources/wiki/get_wiki_data.rb1
-rw-r--r--sources/wiki/lib/mediawikiapi.rb3
4 files changed, 2 insertions, 4 deletions
diff --git a/sources/wiki/get_image_info.rb b/sources/wiki/get_image_info.rb
index 5a08cd8..cabd169 100755
--- a/sources/wiki/get_image_info.rb
+++ b/sources/wiki/get_image_info.rb
@@ -50,7 +50,6 @@ require 'lib/mediawikiapi.rb'
dir = ARGV[0] || '.'
api = MediaWikiAPI::API.new('wiki.openstreetmap.org')
-api.add_header('User-agent', 'taginfo/0.1 (jochen@remote.org)')
db = SQLite3::Database.new(dir + '/taginfo-wiki.db')
db.results_as_hash = true
diff --git a/sources/wiki/get_page_list.rb b/sources/wiki/get_page_list.rb
index 7cdbafa..0ea5976 100755
--- a/sources/wiki/get_page_list.rb
+++ b/sources/wiki/get_page_list.rb
@@ -89,7 +89,6 @@ end
dir = ARGV[0] || '.'
api = MediaWikiAPI::API.new('wiki.openstreetmap.org')
-api.add_header('User-agent', 'taginfo/0.1 (jochen@remote.org)')
namespaces = get_namespaces(api)
diff --git a/sources/wiki/get_wiki_data.rb b/sources/wiki/get_wiki_data.rb
index 0213b1c..8dc4252 100755
--- a/sources/wiki/get_wiki_data.rb
+++ b/sources/wiki/get_wiki_data.rb
@@ -256,7 +256,6 @@ end
dir = ARGV[0] || '.'
api = MediaWikiAPI::API.new('wiki.openstreetmap.org', 80, '/w/index.php?')
-api.add_header('User-agent', 'taginfo/0.1 (jochen@remote.org)')
db = SQLite3::Database.new(dir + '/taginfo-wiki.db')
db.results_as_hash = true
diff --git a/sources/wiki/lib/mediawikiapi.rb b/sources/wiki/lib/mediawikiapi.rb
index 293aa6f..d799041 100644
--- a/sources/wiki/lib/mediawikiapi.rb
+++ b/sources/wiki/lib/mediawikiapi.rb
@@ -8,7 +8,7 @@
#
#------------------------------------------------------------------------------
#
-# Copyright (C) 2012 Jochen Topf <jochen@remote.org>
+# Copyright (C) 2013 Jochen Topf <jochen@remote.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ module MediaWikiAPI
@port = port
@path = path
@headers = {}
+ add_header('User-agent', 'taginfo/1.0 (http://wiki.osm.org/wiki/Taginfo)')
end
def add_header(name, value)