29 Apr 2024

Parse RSS feed in bash

This is probably a fun poke at Planet PostgreSQL itself :) !

Recently I did a multi-part series [1][2][3] on a given topic and ended up "Scheduling" successive posts, so that they don't go out altogether.

And an interesting question came up:

What would be a good day/time for the next post?

A little bit of XML parsing later, I got a hint of what would looks like a lean period!

robins@fw:~/dl$ wget -q https://planet.postgresql.org/rss20_short.xml; echo "cat  //pubDate/text()" | xmllint --shell  rss20_short.xml | grep -ve "----" | grep -v "\/" | date +%A -f - | sort | uniq -c | sort -n
      1 Sunday
      3 Monday
      3 Saturday
      4 Friday
      5 Thursday
      6 Wednesday
      8 Tuesday

Now obviously the count for posts on a given weekday kept changing (depending on when I checked) but Sunday was undeniably a lean day. Given that, for some this may mean that Sunday is NOT the best time to post an article, but think I'll leave that to you 😊 !


Happy reading!

Reference:

No comments:

Parse RSS feed in bash

This is probably a fun poke at Planet PostgreSQL itself :) ! Recently I did a multi-part series [1][2][3] on a given topic and ended up &qu...