OpenStreetMap

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

Comment from gileri on 5 August 2021 at 07:31

Nice script and workaround, thanks for sharing !

since every item contains links to pictures

Some RSS readers have a “low-bandwidth” mode where the images are not loaded, like TinyTinyRss. Maybe that would fit your needs ?

Comment from Riccardo Stagni on 8 August 2021 at 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) :)

Comment from mariotomo on 8 August 2021 at 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

Comment from mariotomo on 10 August 2021 at 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.

Comment from qeef on 15 August 2021 at 14:18

Wouldn’t subscribe via Email from weeklyOSM page just work? (Personally, I haven’t test it yet.)

Comment from mariotomo on 15 August 2021 at 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.

the difference

Comment from qeef on 15 August 2021 at 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.)


Login to leave a comment