Skip to main content

A Hundred Days of Code, Day 029

Awfully proud of myself today.
I wrote little program to scratch an itch, I had.
It’s still rough, but it does what I want it to, and that makes me happpy.
I go to Poetry Foundations’ Poem of the Day ever so often to catch a poem.
And I wondered, what if the daily poem showed up in my RSS reader everyday?
I searched and unfortunately couldn’t find a feed.

So I did the next best thing.
Armed with my newly acquired, Python knowledge, I set out to see if I could just get a link to a new poem daily.
And what I ended up doing was writing a program, that scraped the webpage metadata for the date, compared it to today and if it was, created a baby xml feed for me, that I have now put into my reader.

It’s a blank entry. The title takes me to the poem foundations page, so I don’t miss a day.
I put the program on my linode and then scheduled a cron job that runs the script once a day and moves the xml file to the appropriate place.
Today’s run was brilliant. Let’s see if it holds up tomorrow.

Right now it just overwrites the current item, since that is all I need.
But I could also look at building a list of daily items, if I so desire, later.
I need to just show up every day, for this positive ratchet to continue.
Like Seth says,

The hard part is “steady.”

Anyone can go slow. It takes a special kind of commitment to do it steadily, drip after drip, until you get to where you're going.

The code as usual, is here on Gitlab and Github1


  1. I still have to document it. But I will save all that for another day. More practice to do!