Page MenuHomePhabricator

Minefield: A tool to convert Commons page title to media ID's
Closed, ResolvedPublic

Description

This is a tool that allows you to enter a list of (newline separated) URLS to Commons files (or just page titles) and get the MID (media ID) back. Handy for use in Quickstatements!

https://tools.wmflabs.org/hay/minefield/

Event Timeline

siebrand created this task.Nov 22 2019, 9:37 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 22 2019, 9:37 AM
siebrand triaged this task as Medium priority.Nov 22 2019, 9:38 AM
Husky renamed this task from Create tool to convert Commons page title to media ID and back to Minefield: Create tool to convert Commons page title to media ID and back.Nov 22 2019, 10:04 AM
siebrand renamed this task from Minefield: Create tool to convert Commons page title to media ID and back to Minefield: A tool to convert Commons page title to media ID and back.Nov 22 2019, 10:05 AM

There are various ways to get lists of filenames, and each of them will probably produce different results.

One way is using a Wikidata query: https://w.wiki/CV$ (as described in task T238443: Add P180 (Depicts) and P6243 (Digital representation of) structured data to Commons files representing artworks by Jakob Smits)
An export will give filenames that look like this:

image
http://commons.wikimedia.org/wiki/Special:FilePath/De%20stoet%20van%20de%20magi%C3%ABrs%2C%20Jakob%20Smits%2C%20%281925%29%2C%20Koninklijk%20Museum%20voor%20Schone%20Kunsten%20Antwerpen%2C%202325.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/Smits%20-%20Portrait%20of%20a%20Farmer.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/Smits%20-%20Bespotting%20van%20Jezus.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/Smits%20-%20Christ%20Derided.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/Jakob%20Smits%20%28Rotterdam%201855%20-%20Mol%201928%29%20-%20Plafondstuk%20met%20allegorische%20voorstelling%20van%20Rotterdam%20als%20stad%20van%20kunst%20en%20handel%2C%20wolkenhemel%20me%20-%2023912%20-%20Museum%20Rotterdam.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/0005%20Kempisch%20binnenhuis%201900%201914.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/0009%20Kempisch%20landschap%201927.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/0018%20Vrouw%20aan%20de%20wastobbe.jpg
http://commons.wikimedia.org/wiki/Special:FilePath/0019%20De%20profeet%20Jona%201880.jpg

To keep my life easy, I perhaps would also just like to feed a category into the tool: https://commons.wikimedia.org/wiki/Category:Images_from_Jakob_Smitsmuseum

Another option is using PetScan. Easy for end users would be to feed the tool a PetScan ID that outputs Commons files, example https://petscan.wmflabs.org/?psid=13840179

But alternatively we can use csv or tsv export of this list. Csv export generates this:

"number","title","pageid","namespace","length","touched"
"1","0005_Kempisch_binnenhuis_1900_1914.jpg","80282659","File","818","20191121173306"
"2","0009_Kempisch_landschap_1927.jpg","80282663","File","810","20191121173306"
"3","0018_Vrouw_aan_de_wastobbe.jpg","80282667","File","810","20191121173306"
"4","0019_De_profeet_Jona_1880.jpg","80282673","File","805","20191121173306"
"5","0020_Mater_Amabilis_1895.jpg","80282680","File","804","20191121173306"
"6","0022_Mater_Dei_1895.jpg","80282687","File","802","20191121173306"
"7","0025_Boby_1907.jpg","80282697","File","797","20191118201225"
"8","0029_Frederick_Coburn_1896.jpg","80282707","File","441","20191121173306"
"9","0033_De_zomer_1894.jpg","80282709","File","798","20191121173306"
"10","0036_Portret_van_een_meisje.jpg","80282718","File","811","20191121173306"
"11","0039_Herfstdreef.jpg","80282724","File","800","20191121173306"
"12","0043_Senator_Max_Hallet_1919.jpg","80282728","File","811","20191121173306"
"13","0047_Zelfportret.jpg","80282733","File","792","20191118201225"
"14","0048_De_naaister.jpg","80282742","File","792","20191118201225"
"15","0049_Boby.jpg","80282758","File","785","20191118201225"
"16","0050_Het_kruis_van_mijn_moeder.jpg","80282778","File","806","20191118201225"
"17","0051_Mater_Amabilis_I.jpg","80282806","File","797","20191118201225"
"18","0052_Mater_Amabilis_II.jpg","80282830","File","798","20191118201225"
"19","0053_Mater_Amabilis_III.jpg","80282847","File","799","20191118201225"
"20","0054_De_moeder_bij_de_wieg.jpg","80282855","File","802","20191118201225"
"21","0056_Vrouw_bij_de_wieg_II.jpg","80282858","File","801","20191118201225"
"22","0057_Moeder_en_kind.jpg","80282865","File","795","20191118201225"
"23","0058_Getrouwheid.jpg","80282875","File","792","20191118201225"
"24","0059_Het_gouden_kalf.jpg","80282878","File","796","20191118201225"
"25","0061_Maria_Boodschap_II.jpg","80282885","File","799","20191118201225"
"26","0062_De_visitatie.jpg","80282888","File","793","20191118201225"

Or it can be output as a PagePile, example https://tools.wmflabs.org/pagepile/api.php?action=get_data&id=27096

Husky updated the task description. (Show Details)Nov 22 2019, 10:50 AM

I tried to enter two versions of lists of files in the tool, but the purple Comic Sans just kept dancing in front of me...

http://commons.wikimedia.org/wiki/File:De%20stoet%20van%20de%20magi%C3%ABrs%2C%20Jakob%20Smits%2C%20%281925%29%2C%20Koninklijk%20Museum%20voor%20Schone%20Kunsten%20Antwerpen%2C%202325.jpg
http://commons.wikimedia.org/wiki/File:Smits%20-%20Portrait%20of%20a%20Farmer.jpg
http://commons.wikimedia.org/wiki/File:Smits%20-%20Bespotting%20van%20Jezus.jpg
http://commons.wikimedia.org/wiki/File:Smits%20-%20Christ%20Derided.jpg
http://commons.wikimedia.org/wiki/File:Jakob%20Smits%20%28Rotterdam%201855%20-%20Mol%201928%29%20-%20Plafondstuk%20met%20allegorische%20voorstelling%20van%20Rotterdam%20als%20stad%20van%20kunst%20en%20handel%2C%20wolkenhemel%20me%20-%2023912%20-%20Museum%20Rotterdam.jpg
http://commons.wikimedia.org/wiki/File:0005%20Kempisch%20binnenhuis%201900%201914.jpg
http://commons.wikimedia.org/wiki/File:0009%20Kempisch%20landschap%201927.jpg
http://commons.wikimedia.org/wiki/File:0018%20Vrouw%20aan%20de%20wastobbe.jpg
http://commons.wikimedia.org/wiki/File:0019%20De%20profeet%20Jona%201880.jpg
http://commons.wikimedia.org/wiki/File:0020%20Mater%20Amabilis%201895.jpg
http://commons.wikimedia.org/wiki/File:0022%20Mater%20Dei%201895.jpg
http://commons.wikimedia.org/wiki/File:0025%20Boby%201907.jpg
http://commons.wikimedia.org/wiki/File:0029%20Frederick%20Coburn%201896.jpg
http://commons.wikimedia.org/wiki/File:0033%20De%20zomer%201894.jpg
http://commons.wikimedia.org/wiki/File:0036%20Portret%20van%20een%20meisje.jpg
http://commons.wikimedia.org/wiki/File:0039%20Herfstdreef.jpg
http://commons.wikimedia.org/wiki/File:0043%20Senator%20Max%20Hallet%201919.jpg
http://commons.wikimedia.org/wiki/File:0047%20Zelfportret.jpg
http://commons.wikimedia.org/wiki/File:0048%20De%20naaister.jpg
http://commons.wikimedia.org/wiki/File:0049%20Boby.jpg
http://commons.wikimedia.org/wiki/File:0050%20Het%20kruis%20van%20mijn%20moeder.jpg
http://commons.wikimedia.org/wiki/File:0051%20Mater%20Amabilis%20I.jpg
http://commons.wikimedia.org/wiki/File:0052%20Mater%20Amabilis%20II.jpg
http://commons.wikimedia.org/wiki/File:0053%20Mater%20Amabilis%20III.jpg
http://commons.wikimedia.org/wiki/File:0054%20De%20moeder%20bij%20de%20wieg.jpg
http://commons.wikimedia.org/wiki/File:0056%20Vrouw%20bij%20de%20wieg%20II.jpg
http://commons.wikimedia.org/wiki/File:0057%20Moeder%20en%20kind.jpg
http://commons.wikimedia.org/wiki/File:0058%20Getrouwheid.jpg
http://commons.wikimedia.org/wiki/File:0059%20Het%20gouden%20kalf.jpg
http://commons.wikimedia.org/wiki/File:0061%20Maria%20Boodschap%20II.jpg
http://commons.wikimedia.org/wiki/File:0062%20De%20visitatie.jpg
http://commons.wikimedia.org/wiki/File:0064%20De%20boodschap%20aan%20de%20herders%20II.jpg
http://commons.wikimedia.org/wiki/File:0065%20De%20olifanten.jpg
http://commons.wikimedia.org/wiki/File:0066%20De%20aanbidding%20door%20de%20Wijzen.jpg
http://commons.wikimedia.org/wiki/File:0068%20De%20vlucht%20naar%20Egypte%20II.jpg
http://commons.wikimedia.org/wiki/File:0069%20Christus%20predikend%20in%20de%20schuur.jpg
http://commons.wikimedia.org/wiki/File:0070%20De%20overspelige%20vrouw.jpg
http://commons.wikimedia.org/wiki/File:0071%20Christus%20in%20Bethani%C3%AB.jpg
http://commons.wikimedia.org/wiki/File:0072%20Christus%20bespot.jpg
http://commons.wikimedia.org/wiki/File:0073%20Aan%20de%20schandpaal.jpg
http://commons.wikimedia.org/wiki/File:0074%20De%20Emmausgangers.jpg
http://commons.wikimedia.org/wiki/File:0076%20Het%20symbool%20der%20Kempen%20I.jpg
http://commons.wikimedia.org/wiki/File:0077%20Het%20symbool%20van%20de%20Kempen%20IV.jpg
http://commons.wikimedia.org/wiki/File:0079%20De%20vrouw%20aan%20het%20venster.jpg
http://commons.wikimedia.org/wiki/File:0080%20Kempisch%20binnenhuisje.jpg
http://commons.wikimedia.org/wiki/File:0081%20De%20stal.jpg
http://commons.wikimedia.org/wiki/File:0082%20De%20aardappelschilster.jpg
http://commons.wikimedia.org/wiki/File:0084%20De%20wasvrouw%20II.jpg
http://commons.wikimedia.org/wiki/File:0085%20Vertrek%20naar%20het%20veld.jpg
http://commons.wikimedia.org/wiki/File:0087%20De%20zieke.jpg
http://commons.wikimedia.org/wiki/File:0088%20Kempische%20haard.jpg
http://commons.wikimedia.org/wiki/File:0089%20De%20ossenkar.jpg
http://commons.wikimedia.org/wiki/File:0090%20Zandvlakten%20van%20de%20Kongo%20te%20Achterbos.jpg
http://commons.wikimedia.org/wiki/File:0091%20De%20windmolen%20te%20Achterbos.jpg
http://commons.wikimedia.org/wiki/File:0092%20Landschap%20met%20molen.jpg
http://commons.wikimedia.org/wiki/File:0094%20Achterbos%201903.jpg
http://commons.wikimedia.org/wiki/File:0095%20Landschap%20met%20grote%20witte%20wolken%201910.jpg
http://commons.wikimedia.org/wiki/File:0095%20Landschap%20met%20grote%20witte%20wolken%201910.jpg
http://commons.wikimedia.org/wiki/File:0096%20Het%20kapelletje%20tussen%20de%20bomen.jpg
http://commons.wikimedia.org/wiki/File:0098%20Kempisch%20dorp%20II.jpg
http://commons.wikimedia.org/wiki/File:0099%20De%20kerk.jpg
http://commons.wikimedia.org/wiki/File:0100%20Op%20wandel.jpg
http://commons.wikimedia.org/wiki/File:0102%20De%20hoeve%20%27s%20avonds.jpg
http://commons.wikimedia.org/wiki/File:0103%20De%20Kempen.jpg
http://commons.wikimedia.org/wiki/File:0105%20Arme%20vrouwen%201910.jpg
http://commons.wikimedia.org/wiki/File:0106%20De%20armen.jpg
http://commons.wikimedia.org/wiki/File:0107%20Kleine%20bedelaarster.jpg
http://commons.wikimedia.org/wiki/File:0108%20Gehucht%20in%20de%20Kempen.jpg
http://commons.wikimedia.org/wiki/File:0109%20De%20drie%20geslachten.jpg
http://commons.wikimedia.org/wiki/File:0110%20Bij%20het%20vallen%20van%20de%20nacht.jpg
http://commons.wikimedia.org/wiki/File:0111%20Moeders%20vermaning.jpg
http://commons.wikimedia.org/wiki/File:0112%20Moeders%20berisping.jpg
http://commons.wikimedia.org/wiki/File:0113%20Vrouw%20en%20kind%20bij%20de%20hoeve.jpg
http://commons.wikimedia.org/wiki/File:0114%20De%20man%20met%20de%20waterketel.jpg
http://commons.wikimedia.org/wiki/File:0115%20De%20kruiwagen.jpg
http://commons.wikimedia.org/wiki/File:0116%20De%20vrouw%20met%20de%20kruiwagen.jpg
http://commons.wikimedia.org/wiki/File:0117%20De%20man%20met%20de%20schop.jpg
http://commons.wikimedia.org/wiki/File:0118%20De%20oogst.jpg
http://commons.wikimedia.org/wiki/File:0119%20De%20aardappeloogst.jpg
http://commons.wikimedia.org/wiki/File:0120%20Varkenskooplieden.jpg
http://commons.wikimedia.org/wiki/File:0121%20Het%20geslachte%20varken.jpg
http://commons.wikimedia.org/wiki/File:0122%20Boterboerin.jpg
http://commons.wikimedia.org/wiki/File:0123%20Slachtoffer%20van%20de%20arbeid.jpg
http://commons.wikimedia.org/wiki/File:0124%20Openbare%20veiling%20I.jpg
http://commons.wikimedia.org/wiki/File:0125%20Openbare%20veiling%20II.jpg
http://commons.wikimedia.org/wiki/File:0126%20Het%20kruisbeeld.jpg
http://commons.wikimedia.org/wiki/File:0127%20Het%20kapelletje.jpg
http://commons.wikimedia.org/wiki/File:0128%20Schoolgaande%20kinderen.jpg
http://commons.wikimedia.org/wiki/File:0130%20Vermaak%20bij%20overstroming.jpg
http://commons.wikimedia.org/wiki/File:0132%20Honni%20soit%20qui%20mal%20y%20pense%20II.jpg
http://commons.wikimedia.org/wiki/File:0135%20De%20rondedans%20II.jpg
http://commons.wikimedia.org/wiki/File:0136%20Het%20kerstverhaal.jpg
http://commons.wikimedia.org/wiki/File:0137%20Antwerpen%201911.jpg
http://commons.wikimedia.org/wiki/File:0138%20De%20rede.jpg
http://commons.wikimedia.org/wiki/File:0139%20De%20leeuw.jpg
http://commons.wikimedia.org/wiki/File:0145%20Charles%20Claessens.jpg
http://commons.wikimedia.org/wiki/File:0152%20De%20spinster%201888.jpg
http://commons.wikimedia.org/wiki/File:0159%20Gezin%20aan%20tafel.jpg
http://commons.wikimedia.org/wiki/File:0161%20Moeder%20met%20het%20geitje.jpg
http://commons.wikimedia.org/wiki/File:0162%20De%20veroordeling%20van%20de%20stroper.jpg
http://commons.wikimedia.org/wiki/File:0167%20Het%20naaistertje.jpg
http://commons.wikimedia.org/wiki/File:0169%20Kempisch%20dorp%201924.jpg
http://commons.wikimedia.org/wiki/File:0176%20Dorpsstraat%20%282%29.jpg
http://commons.wikimedia.org/wiki/File:0177%20Aardappelraapsters.jpg
http://commons.wikimedia.org/wiki/File:0193%20Jef%20Van%20Hoof-1908.jpg
http://commons.wikimedia.org/wiki/File:0198%20Kerk%20bij%20maanlicht.jpg
http://commons.wikimedia.org/wiki/File:0202%20Het%20werkongeval.jpg
http://commons.wikimedia.org/wiki/File:0218%20Interieur%20met%20wieg.jpg
http://commons.wikimedia.org/wiki/File:0247%20Interieur%20met%20zittende%20vrouw.jpg
http://commons.wikimedia.org/wiki/File:0275%20Campine%20de%20G.%20Eekhoud.jpg
http://commons.wikimedia.org/wiki/File:0427%20De%20appelsienen.jpg
http://commons.wikimedia.org/wiki/File:0492%20De%20Judaskus.jpg

And this list (a PagePile export) also brought me to a perpetually jumping purple Comic Sans message:

File:0005 Kempisch binnenhuis 1900 1914.jpg
File:0009 Kempisch landschap 1927.jpg
File:0018 Vrouw aan de wastobbe.jpg
File:0019 De profeet Jona 1880.jpg
File:0020 Mater Amabilis 1895.jpg
File:0022 Mater Dei 1895.jpg
File:0025 Boby 1907.jpg
File:0029 Frederick Coburn 1896.jpg
File:0033 De zomer 1894.jpg
File:0036 Portret van een meisje.jpg
File:0039 Herfstdreef.jpg
File:0043 Senator Max Hallet 1919.jpg
File:0047 Zelfportret.jpg
File:0048 De naaister.jpg
File:0049 Boby.jpg
File:0050 Het kruis van mijn moeder.jpg
File:0051 Mater Amabilis I.jpg
File:0052 Mater Amabilis II.jpg
File:0053 Mater Amabilis III.jpg
File:0054 De moeder bij de wieg.jpg
File:0056 Vrouw bij de wieg II.jpg
File:0057 Moeder en kind.jpg
File:0058 Getrouwheid.jpg
File:0059 Het gouden kalf.jpg
File:0061 Maria Boodschap II.jpg
File:0062 De visitatie.jpg
File:0064 De boodschap aan de herders II.jpg
File:0065 De olifanten.jpg
File:0066 De aanbidding door de Wijzen.jpg
File:0068 De vlucht naar Egypte II.jpg
File:0069 Christus predikend in de schuur.jpg
File:0070 De overspelige vrouw.jpg
File:0071 Christus in Bethanië.jpg
File:0072 Christus bespot.jpg
File:0073 Aan de schandpaal.jpg
File:0074 De Emmausgangers.jpg
File:0076 Het symbool der Kempen I.jpg
File:0077 Het symbool van de Kempen IV.jpg
File:0079 De vrouw aan het venster.jpg
File:0080 Kempisch binnenhuisje.jpg
File:0081 De stal.jpg
File:0082 De aardappelschilster.jpg
File:0084 De wasvrouw II.jpg
File:0085 Vertrek naar het veld.jpg
File:0087 De zieke.jpg
File:0088 Kempische haard.jpg
File:0089 De ossenkar.jpg
File:0090 Zandvlakten van de Kongo te Achterbos.jpg
File:0091 De windmolen te Achterbos.jpg
File:0092 Landschap met molen.jpg
File:0093 Het dorp Achterbos.jpg
File:0094 Achterbos 1903.jpg
File:0095 Landschap met grote witte wolken 1910.jpg
File:0096 Het kapelletje tussen de bomen.jpg
File:0098 Kempisch dorp II.jpg
File:0099 De kerk.jpg
File:0100 Op wandel.jpg
File:0102 De hoeve 's avonds.jpg
File:0103 De Kempen.jpg
File:0105 Arme vrouwen 1910.jpg
File:0106 De armen.jpg
File:0107 Kleine bedelaarster.jpg
File:0108 Gehucht in de Kempen.jpg
File:0109 De drie geslachten.jpg
File:0110 Bij het vallen van de nacht.jpg
File:0111 Moeders vermaning.jpg
File:0112 Moeders berisping.jpg
File:0113 Vrouw en kind bij de hoeve.jpg
File:0114 De man met de waterketel.jpg
File:0115 De kruiwagen.jpg
File:0116 De vrouw met de kruiwagen.jpg
File:0117 De man met de schop.jpg
File:0118 De oogst.jpg
File:0119 De aardappeloogst.jpg
File:0120 Varkenskooplieden.jpg
File:0121 Het geslachte varken.jpg
File:0122 Boterboerin.jpg
File:0123 Slachtoffer van de arbeid.jpg
File:0124 Openbare veiling I.jpg
File:0125 Openbare veiling II.jpg
File:0126 Het kruisbeeld.jpg
File:0127 Het kapelletje.jpg
File:0128 Schoolgaande kinderen.jpg
File:0130 Vermaak bij overstroming.jpg
File:0132 Honni soit qui mal y pense II.jpg
File:0135 De rondedans II.jpg
File:0136 Het kerstverhaal.jpg
File:0137 Antwerpen 1911.jpg
File:0138 De rede.jpg
File:0139 De leeuw.jpg
File:0145 Charles Claessens.jpg
File:0152 De spinster 1888.jpg
File:0159 Gezin aan tafel.jpg
File:0161 Moeder met het geitje.jpg
File:0162 De veroordeling van de stroper.jpg
File:0167 Het naaistertje.jpg
File:0169 Kempisch dorp 1924.jpg
File:0176 Dorpsstraat (2).jpg
File:0177 Aardappelraapsters.jpg
File:0193 Jef Van Hoof-1908.jpg
File:0198 Kerk bij maanlicht.jpg
File:0202 Het werkongeval.jpg
File:0218 Interieur met wieg.jpg
File:0247 Interieur met zittende vrouw.jpg
File:0275 Campine de G. Eekhoud.jpg
File:0427 De appelsienen.jpg
File:0492 De Judaskus.jpg
Husky added a comment.Nov 22 2019, 1:18 PM

A fixed a couple of problems and all the example lists posted in this issue should now work!

Husky renamed this task from Minefield: A tool to convert Commons page title to media ID and back to Minefield: A tool to convert Commons page title to media ID's.Nov 22 2019, 1:19 PM
Husky updated the task description. (Show Details)
Husky added a comment.EditedNov 22 2019, 3:53 PM

I've also added support for PagePile ids now. Also in the hash by the way:

https://tools.wmflabs.org/hay/minefield/#pagepile=27096

Harmonia_Amanda added a subscriber: Harmonia_Amanda.

Can you add this tool on the official list of tools you can open a PagePile with? For example: https://tools.wmflabs.org/pagepile/api.php?action=get_data&id=27097 you have a button "Use this pagepile in [list of tools]".

Can you add this tool on the official list of tools you can open a PagePile with? For example: https://tools.wmflabs.org/pagepile/api.php?action=get_data&id=27097 you have a button "Use this pagepile in [list of tools]".

https://bitbucket.org/magnusmanske/pagepile/pull-requests/9/add-minefield-as-consumer/diff

Husky claimed this task.Nov 23 2019, 10:41 PM
Husky added a subscriber: SandraF_WMF.

Can you add this tool on the official list of tools you can open a PagePile with? For example: https://tools.wmflabs.org/pagepile/api.php?action=get_data&id=27097 you have a button "Use this pagepile in [list of tools]".

https://bitbucket.org/magnusmanske/pagepile/pull-requests/9/add-minefield-as-consumer/diff

✔ done \o/

Ecritures closed this task as Resolved.Dec 2 2019, 9:54 AM