A week ago I posted about my attempts to automate an administrative task with Python. In essence, I’m trying to scrape links to sound files off the Radio New Zealand site and insert them into an entry on my blog. I can only test this on Thursdays, because the links are only present then.
Read on for my experiences yesterday and a revised program.
So, yesterday I ran it again, and I had to tweak it a bit but it did then work. I’ve also installed a loop to wait for the links. The biggest problem was that my assumption that the sound file names would contain New_Tech – this week they just contained the word “technology”.
So, the revised program – the one that worked – looked like this.
Where to from here?
- I’d like to improve the code that finds the sound file links – the link names change and it’s likely to prove unreliable. Instead, I could trigger on my name being in the link but that’s not a constant, either. Probably I’m going to have to re-write it to look for the text introducing the links, then find the links themselves. Just not now.
- I need to get this running without human assistance, probably using a cron job on a GNU/Linux server at home. Hopefully by next week.