Every week we get an alert from the very dedicated OSMBC group, that a new issue is ready on the site. I’m in a country where internet connectivity is expensive, and slow, and unreliable, all at the same time, so I wish to avoid opening the web site with all of its javascript and css files, and only get the information without the site software.
I’ve not been able to make the above situation considered, or understood, but I could use one of the hints I received, namely to check the RSS feed for the newsletter. This feed contains one item per week, and the latest item is the one I want to receive in my mailbox. I first simply added the feed to my Android RSS client, but since every item contains links to pictures, refreshing the feed would again clog my slow limited connection.
What I did was to write a bash one-liner which will run every Sunday on a server hosted in Europe, to which I have access. The script grabs the RSS feed, extracts the first item, and sends it to me by email. Which is what I wanted, so I’m fine now.
Should anybody want to be included in the mail, I have no problem sending them any of the OSMWeekly translations. the only limitation is I can’t send email to google.com.
the script is more or less this:
wget -qO- "https://weeklyosm.eu/feed" | sed -n -e '1,/^\]\]><\/content:encoded>/p' | sed -n -e '/<content:encoded>/,/^\]\]/p' | sed -e 's/.*CDATA.//' -e 's/^\]\]><\/content:encoded>//' | grep -v '^<p class="wp-caption-text"><img loading="lazy" src=".*alt="lead picture"' | grep -v '<p><!-- place picture here --></p>' | mail -a "Content-Type: text/html" -s "OSM Weekly" email@example.com
討論
由gileri於2021年8月5日07:31發表的評論
Nice script and workaround, thanks for sharing !
Some RSS readers have a “low-bandwidth” mode where the images are not loaded, like TinyTinyRss. Maybe that would fit your needs ?
由Riccardo Stagni於2021年8月8日09:55發表的評論
Nice workaround indeed, but you may have problems in case of changes of the order of the entries in the feed… And you may risk having duplicate/lost entries if the script doesn’t run “at the right moment”.
Did you consider rss2email? (it’s more like a proper feed reader, with its own db, etc… but hey, no need to deal with xml with sed/grep) :)
由mariotomo於2021年8月8日14:55發表的評論
buongiorno Riccardo, grazie per la dritta!
I wasn’t aware of the project rss2email and if I may judge it from the documentation, I do quite like it.
if you followed how this developed on the mailing lists and Telegram groups, you understood that I consider my ‘workaround’ as a symptom of a situation which, I hope, the WeeklyOSM team will acknowledge and address directly.
grazie ancora per rss2email, me lo installo subito! MF
由mariotomo於2021年8月10日14:32發表的評論
about the RSS readers and low-bandwidth, I am following several news sources, all with which report their news with a single small thumbnail, and I’m happy with receiving them. I do not know why the WeeklyOSM is able to take such a long time for updating. maybe the thumbnails are at full resolution? anyhow: I’d rather not give up thumbnails all over the place only because one feed goes heavy on them, I prefer giving up that single feed, as I also did.
as usual: if it works, don’t fix it. and at the moment my patchy solution works.
由qeef於2021年8月15日14:18發表的評論
Wouldn’t subscribe via Email from weeklyOSM page just work? (Personally, I haven’t test it yet.)
由mariotomo於2021年8月15日15:55發表的評論
when subscribing to the WeeklyOSM, I get a link, now with my script I get the content, which is ways more compact than visiting the site at the link.
由qeef於2021年8月15日19:52發表的評論
Uh, I though that Subscribe to weeklyOSM via Email will send the content of the page. (I just subscribed, so I will see next week.)
I am also subscribed to talk mailing list, where only announcement about new weekly is posted with no content. (I understand that is not a solution for you.)