water-fountains / proximap

a responsive Angular 6 web app for finding nearby fountains
https://beta.water-fountains.org
Other
16 stars 9 forks source link

display image caption #285

Open ralfhauser opened 5 years ago

ralfhauser commented 5 years ago

e.g. https://h2o.do/tr-be?l=en&i=Q67080459 has quite some description (that would be really hard to get into wikipedia :( ) but still worthwhile to be displayed (or rather https://commons.wikimedia.org/wiki/File:26.77-Hatuniye_%C3%87e%C5%9Fmesi-1876_01.jpg has the description)

image

ralfhauser commented 4 years ago

or take it from the category text as in https://commons.wikimedia.org/wiki/Category:Hatuniye_%C3%87e%C5%9Fmesi-1876

stankomix commented 4 years ago

@ralfhauser /fountain api gives us just this short description, what is the way to get category description ?

ralfhauser commented 4 years ago

image

ralfhauser commented 4 years ago

left, use the wikimedia icon image

to the right have the link e.g. to the caption target e-g- https://commons.wikimedia.org/wiki/File:26.77-Hatuniye_Çeşmesi-1876_01.jpg#ooui-php-1

behind image

ralfhauser commented 4 years ago

10) Make a filter such that one can see which fountains have a caption and which not

ralfhauser commented 4 years ago
  1. make links inside the caption target="_blank" e.g. "Rennweg" in https://beta.water-fountains.org/ch-zh?l=en&i=Q27230037
ralfhauser commented 4 years ago

the query doesn't give the real caption text https://stackoverflow.com/questions/61302503/how-to-search-for-image-caption-in-wikimedia-commons-by-api

https://phabricator.wikimedia.org/T250777

Solution: https://commons.wikimedia.org/w/api.php?action=wbgetentities&format=json&sites=commonswiki&titles=File%3ABrunnen_Winterthurerstrasse_Tramstation_Langmauerstrasse.jpg

ralfhauser commented 4 years ago

https://commons.wikimedia.org/w/api.php?action=query&titles=Category:Brunnen_Winterthurerstrasse_Tramstation_Langmauerstrasse&prop=extracts

seems to stop before 1200 characters (payload):

https://commons.wikimedia.org/w/api.php?action=query&titles=Category:Brunnen_Winterthurerstrasse_Tramstation_Langmauerstrasse&prop=extracts&exchars=1200

ralfhauser commented 4 years ago

https://commons.wikimedia.org/w/api.php?action=query&titles=Category:Brunnen_Winterthurerstrasse_Tramstation_Langmauerstrasse&prop=extracts&explaintext

may be better as it doesn't provide the html-markup