Created
July 11, 2012 16:38
-
-
Save awjrichards-zz/3091602 to your computer and use it in GitHub Desktop.
Updated generate_campaigns.py to get full json object of all wlm campaigns, and resulting js/json output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.CAMPAIGNS = [ | |
{ | |
"isenabled": 1, | |
"desc": "Andorra", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{B\u00e9ns Andorra|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ad-header/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Andorra" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ad-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "ad", | |
"id": 4 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Austria", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{Denkmalgesch\u00fctztes Objekt \u00d6sterreich|1=$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-at-header/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Austria" | |
], | |
"skipTutorial": "", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-at", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0-at" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-at-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "at", | |
"id": 12 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Belgium (Brussels)", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{WLM-identifier|be-bru|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-be-bru-header/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Brussels" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-be-bru-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "be-bru", | |
"id": 33 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Belgium (Flanders)", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{Onroerend erfgoed|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-be-vlg-header/$1", | |
"defaultCategories": [ | |
"Onroerend erfgoed in Flanders" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-be-vlg-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "be-vlg", | |
"id": 34 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Belgium (Wallonia)", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{WLM-identifier|be-wal|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-be-wal-header/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Wallonia" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-be-wal-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "be-wal", | |
"id": 35 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Estonia", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{Kultuurim\u00e4lestis|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ee-header/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Estonia" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-ee", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0-ee" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ee-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "ee", | |
"id": 15 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "France", | |
"config": { | |
"idFieldLabel": "Identifiant dans la base M\u00e9rim\u00e9e", | |
"idField": "{{M\u00e9rim\u00e9e|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-fr-header/$1", | |
"defaultCategories": [ | |
"Monuments historiques in France" | |
], | |
"skipTutorial": "", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-fr-id/$1", | |
"autoCategories": [ | |
"Images from Wiki Loves Monuments 2011 in France after deadline" | |
], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "10" | |
}, | |
"name": "fr", | |
"id": 31 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Germany (Bavaria)", | |
"config": { | |
"idFieldLabel": "Stadt oder Gemeinde, f\u00fcr M\u00fcnchen: Stadtteil", | |
"idField": "{{safesubst:WLM2011-DE-BY|$1}}", | |
"headerLabelPage": "Commons:Wiki Loves Monuments upload/de/wizard-intro-de-by", | |
"defaultCategories": [ | |
"Images from Wiki Loves Monuments 2011, DE-BY" | |
], | |
"skipTutorial": "", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "900", | |
"tutorialTemplate": "WLM Introscreen UploadWizard-de.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "", | |
"autoCategories": [], | |
"autoWikiText": "\n", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "de-by", | |
"id": 13 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Germany (Hesse)", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{safesubst:WLM2011-DE-HE|$1}}", | |
"headerLabelPage": "Commons:Wiki Loves Monuments upload/de/wizard-intro-de-he", | |
"defaultCategories": [ | |
"Images from Wiki Loves Monuments 2011, DE-HE" | |
], | |
"skipTutorial": "", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "900", | |
"tutorialTemplate": "WLM Introscreen UploadWizard-de.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "Commons:Wiki Loves Monuments upload/de/label-ortshinweis", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "de-he", | |
"id": 20 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Germany (nrw-bm)", | |
"config": { | |
"idFieldLabel": "Denkmalnummer", | |
"idField": "{{Kulturdenkmal Bergheim|$1}}", | |
"headerLabelPage": "Commons:Wiki Loves Monuments upload/de/wizard-intro-de-bm", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Bergheim" | |
], | |
"skipTutorial": "", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "900", | |
"tutorialTemplate": "WLM_Introscreen_UploadWizard-de-nrw-bm.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "", | |
"autoCategories": [ | |
"Images from Wiki Loves Monuments 2011, DE-NW" | |
], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "de-nrw-bm", | |
"id": 30 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Germany (nrw-k)", | |
"config": { | |
"idFieldLabel": "Denkmalnummer aus der Liste", | |
"idField": "{{Kulturdenkmal K\u00f6ln|$1}}", | |
"headerLabelPage": "Commons:Wiki Loves Monuments upload/de/wizard-intro-de-k", | |
"defaultCategories": [ | |
"Maintenance for cultural heritage monuments in Cologne" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "900", | |
"tutorialTemplate": "WLM Introscreen UploadWizard-de-nrw-k.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "", | |
"autoCategories": [ | |
"Cultural heritage monuments in Cologne" | |
], | |
"autoWikiText": "", | |
"thanksLabelPage": "", | |
"tutorialHelpdeskCoords": "", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "de-nrw-k", | |
"id": 48 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Luxemburg", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-lu-header/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Luxembourg" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-lu", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0-lu" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-lu-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "lu", | |
"id": 37 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Netherlands", | |
"config": { | |
"idFieldLabel": "Rijksmonument nummer", | |
"idField": "{{Rijksmonument|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-nl-header/$1", | |
"defaultCategories": [ | |
"Rijksmonumenten" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-nl", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0-nl" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-nl-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "nl", | |
"id": 5 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Norway", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{Monument Norge|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-no-header/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Norway" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-no", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0-no" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-no-id", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "no", | |
"id": 11 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Poland", | |
"config": { | |
"idFieldLabel": "Nr rejestrowy obiektu", | |
"idField": "", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-pl-header/$1", | |
"defaultCategories": [], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-pl", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0-pl" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-pl-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "pl", | |
"id": 9 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Portugal", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{WLM-PT|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-pt-notice/$1", | |
"defaultCategories": [ | |
"Cultural heritage monuments in Portugal" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-pt-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "pt", | |
"id": 8 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Romania", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{Monument istoric|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ro-header/$1", | |
"defaultCategories": [ | |
"Historical_monuments_in_Romania" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-ro", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0-ro" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ro-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "ro", | |
"id": 7 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Spain", | |
"config": { | |
"idFieldLabel": "Identificador del monumento", | |
"idField": "{{BIC|$1}}", | |
"headerLabelPage": "Commons:Wiki_Loves_Monuments_upload/$1/wizard-intro-es", | |
"defaultCategories": [ | |
"Category:Cultural heritage monuments in Spain" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0-es", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0", | |
"cc-by-3.0", | |
"own-pd", | |
"cc-by-sa-3.0-es" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-es-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "es", | |
"id": 16 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Sweden", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "{{BBR|$1}}", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-se-header/$1", | |
"defaultCategories": [ | |
"Protected buildings in Sweden" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-se-id/$1", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25" | |
}, | |
"name": "se", | |
"id": 38 | |
}, | |
{ | |
"isenabled": 1, | |
"desc": "Switzerland", | |
"config": { | |
"idFieldLabel": "", | |
"idField": "", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-ch-header/$1", | |
"defaultCategories": [ | |
"Cultural properties of national significance in Switzerland" | |
], | |
"skipTutorial": "1", | |
"ownWorkOption": "own", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"idFieldLabelPage": "", | |
"autoCategories": [], | |
"autoWikiText": "{{Wiki Loves Monuments 2011|ch}}", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "" | |
}, | |
"name": "ch", | |
"id": 36 | |
}, | |
{ | |
"isenabled": 0, | |
"desc": "United States", | |
"config": { | |
"defaultLon": "", | |
"idFieldLabel": "National Register of Historic Places listing ID", | |
"idField": "{{NRHP|$1}}", | |
"defaultAlt": "", | |
"defaultCategories": [ | |
"National Register of Historic Places" | |
], | |
"skipTutorial": "1", | |
"defaultDescription": "", | |
"defaultOwnWorkLicence": "cc-by-sa-3.0", | |
"tutorialWidth": "720", | |
"tutorialTemplate": "Licensing_tutorial_$1.svg", | |
"licensesOwnWork": [ | |
"cc-by-sa-3.0" | |
], | |
"defaultLat": "", | |
"idFieldLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-us-id/$1", | |
"idFieldInitialValue": "", | |
"autoCategories": [], | |
"autoWikiText": "", | |
"thanksLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-eu-use/$1", | |
"ownWorkOption": "own", | |
"tutorialHelpdeskCoords": "27, 1319, 691, 1384", | |
"idFieldMaxLength": "25", | |
"headerLabelPage": "MediaWiki:Mwe-upwiz-campaigns-wlm-us-header/$1" | |
}, | |
"name": "us", | |
"id": 58 | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib2 import urlopen, HTTPError | |
try: | |
import json | |
except: | |
import simplejson as json | |
UPLOADCAMPAIGN_URL = "http://commons.wikimedia.org/w/api.php?action=uploadcampaign&format=json&ucprop=config" | |
NAMES_URL = "http://commons.wikimedia.org/wiki/Commons:Monuments_database/Campaign_names?action=raw" | |
campdata = json.loads(urlopen(UPLOADCAMPAIGN_URL).read())['uploadcampaign']['campaigns'] | |
# HACK: Bring up display names from separate file on wiki for now. Should be added to UploadCampaign info itself, or surfaced via Admin listings soon | |
nametext = urlopen(NAMES_URL).read() | |
namesdata = dict([(s.split('=')[0].strip(), s.split('=')[1].strip()) for s in nametext.split("\n")]) | |
campaigns = [] | |
for camp in campdata: | |
if camp['name'].startswith('wlm'): | |
camp['name'] = camp['name'].replace('wlm-','') | |
if camp['name'] in namesdata: | |
campaign = camp | |
campaign['desc'] = namesdata[campaign['name']] | |
campaigns.append( campaign ) | |
print campaign['name'], campaign['desc'] | |
print len(campaigns) | |
campaigns = sorted(campaigns, key=lambda k: k['desc']) | |
open("campaigns-data-test.js", "w").write('window.CAMPAIGNS = ' + json.dumps(campaigns, indent=4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternatively, we could make campaigns a dict and have each campaign keyed based on its name for trivial retrieval of its data.