openzim / mwoffliner

Mediawiki scraper: all your wiki articles in one highly compressed ZIM file
https://www.npmjs.com/package/mwoffliner
GNU General Public License v3.0
271 stars 72 forks source link

Provide better logo images in Wikimedia ZIM files favicon metadata #49

Open kelson42 opened 7 years ago

kelson42 commented 7 years ago

With data from Wikidata

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?item ?itemLabel $logotype WHERE {
  ?item wdt:P154 ?logotype. 
  ?item wdt:P856 <https://fr.wikivoyage.org/> .
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "fr"
   }
}
kelson42 commented 7 years ago
$ curl -g 'https://query.wikidata.org/sparql?format=json&query=PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%3Fitem%20%3FitemLabel%20%24logotype%20WHERE%20{%0A%20%20%3Fitem%20wdt%3AP154%20%3Flogotype.%20%0A%20%20%3Fitem%20wdt%3AP856%20%3Chttps%3A%2F%2Ffr.wikivoyage.org%2F%3E%20.%0A%20%20%20SERVICE%20wikibase%3Alabel%20{%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22fr%22%0A%20%20%20}%0A}'
{
  "head" : {
    "vars" : [ "item", "itemLabel", "logotype" ]
  },
  "results" : {
    "bindings" : [ {
      "item" : {
        "type" : "uri",
        "value" : "http://www.wikidata.org/entity/Q19826572"
      },
      "logotype" : {
        "type" : "uri",
        "value" : "http://commons.wikimedia.org/wiki/Special:FilePath/Wikivoyage-Logo-v3-en.svg"
      },
      "itemLabel" : {
        "xml:lang" : "fr",
        "type" : "literal",
        "value" : "Wikivoyage en français"
      }
    } ]
  }
}
kelson42 commented 6 years ago

The idea is to provide X /M/faviconheigtxwidth entries. It would be then easy by search all urls starting with "/M/favicon" what kind of resolutions are available and pick the good one.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

kelson42 commented 1 year ago

This has to be implememted at Zimfarm level.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.