Re:Show HN: Set NASA APOD as Ubuntu Desktop Background
by randomdrake on Sunday July 29, 2012 @08:44PM
(#4310373)
I plan on using an actual DOM parser on my next pass as I fully stand by and believe that you should never parse markup with regex.
I wrote a little parser for this site a while back to display the daily photo as a desktop gadget, and had to resort to the same hack to get the image out. It's a shame there isn't a rss feed for this yet.. it is a bit hard to be believe that in this day and age, thousands of pieces of code around the world are relying on how one guy decided to write his html.
[Ninja Edit:] For what it is worth, here's the regex I actually ended up using:
but obviously, this is equally fragile.