Finally got the program done!
I wanted to write a program that would just get the latest comic from turnoff.us and save the picture to a file.
In the course of writing this little program,
- I learnt about the basics of context handlers
- I learnt about the
osmodule in Python
- I learnt how to scrape a web page using requests, beautiful soup and feedparser. (I was going to originally scrape the web page, but then realised that processing the rss feed would be more efficient. I think it’ll also help me extend/improve the program better, later.
- It helped me practice, slicing and dicing Python lists and dictionaries and getting data out of them.
- I learnt how to write and save files to disk.
This was really fun to do.
I see a million ways to take this dinky, little program forward. It could do the whole site for example or download only after comparing the state of the rss feed and fetching new entries etc. It has no error handling at all currently, and I prefer to have very safe, very conservative programs as a user. So lots of work to do. I leave all this for a later date though, while I now forge ahead with my #100DaysOfCode journey.
Getting back to the challenges of the course itself, tomorrow onwards.