sailfishos-applications / daily-comics

Comic strips reader for SailfishOS
https://openrepos.net/content/olf/daily-comics
Other
2 stars 1 forks source link

[Fix comics] Helsingin Sanomat comics at https://www.hs.fi/sarjakuvat/ #103

Open ExTechOp opened 2 days ago

ExTechOp commented 2 days ago

Daily Comics VERSION (Daily Comics → [Top pulley] About): <1.9.95>

\<Please do name only a single comic / cartoon in each "fix comic" suggestion! The only exception is when a format change by a comics provider affects multiple comics retrieved from this provider.>

NECESSARY DATA

ADDITIONAL INFORMATION

\<Please consider thoroughly which other pieces of information might be relevant.>

Three HS comics stopped working at the same time: simultaneously: Fingerpori, Viivi ja Wagner, and FOK_IT

Olf0 commented 2 days ago

Technically this should not be hard for the comics at Helsingin Sanomat: Take a look by Inspect (left mouse button on an item on an HTML-page in a web-browser for desktop computers, e.g. Firefox) a comic strip panel or look at the page source.

An exemplary comic list item looks like this (using https://www.hs.fi/fingerpori/ on 2024-10-12):

<span class="date">Lauantaina, 12.10.</span>
</span>
<a href="/fingerpori/car-2000010758312.html">
<figure class="cartoon image scroller" itemscope itemtype="http://schema.org/ImageObject" id="cartoon-2000010758312">
<img id="image-8145639"
class="lazyload lazyloadable-image "
data-alt=""
data-simple-src="//images.sanoma-sndp.fi/d46c8befaf65903b8f0ad5cc969d5bd2.jpg/normal/320.jpg"
data-srcset="//images.sanoma-sndp.fi/d46c8befaf65903b8f0ad5cc969d5bd2.jpg/normal/1920.jpg 1920w"
/>

Hence the RegEx should be something like (untested): /data-srcset="(\/\/[^" ]+)/ Mind that the extracted link from the first match (only) has to be prepended with an https: before returning it.

The same should be applicable for all comics there (see https://www.hs.fi/sarjakuvat/):

Name Original name Author(s) Web page
Fingerpori - Pertti Jarla https://www.hs.fi/fingerpori/
Viivi ja Wagner - Juba Tuomola https://www.hs.fi/viivijawagner/
Fok_it - Joonas Rinta-Kanto https://www.hs.fi/sarjakuvat/fokit/
Keskenkasvuisia - Jyrki Vainio
ja
Aurora Raiskinen
https://www.hs.fi/sarjakuvat/keskenkasvuisia/
Harald Hirmuinen Hägar the Horrible Dik Browne
Chris Browne
https://www.hs.fi/haraldhirmuinen/
Lassi ja Leevi Calvin and Hobbes Bill Watterson https://www.hs.fi/lassijaleevi/

P.S.: Please also check the generic metadata of the extant Daily Comics plug-ins for HS (authors etc.) is still correct.

P.P.S.: I currently absolutely lack the time (at least for the next couple of months) for implementing and testing the plug-ins for the comics at Helsingin Sanomat (it actually makes sense to implement them all, because that is little extra work, once one is working properly), but it is should be easy by the help of this guide: https://github.com/sailfishos-applications/daily-comics/blob/devel/info/comic_addition.md Well, requires a little JavaScript and RegEx know-how, which can be acquired by the many tutorials and references in the WWW on these two topics.

But I will sure try to give good advice if you need support with this and ask something specific, review a resulting PR, and ultimately create a new release, when your PR became merged. Looking forward to your contribution!