November 29, 2011

Another reminder to myself

Tonight I had another one of those deja vu moments where I realize (after too long stumbling around) that I've been down this particular road before.  I'm leaving this note here for myself to remind me in the future how to do this trick.

I wanted to post the daily image from the Astronomy Picture of the Day webpage to the class webpage in the college's CMS so that it updates everyday.  If I had access to the server, I'm sure I could write a perl/php/wget/python/bash script to automatically do this. I don't have access to the server, obviously. And, of course, I don't really know enough javascript to be dangerous enough to write a page to embed in the CMS course page.

After much googling, I found Feed2JS, an RSS feed to JavaScript converter. I put in the APOD feed and tweaked a few of the settings, then generated my javascript code, which I was able to embed in the course page.  Since I only want to show one image, I set the number of items to display to 1.

After getting it to work I decided that I wanted the full sized image for the course page.  A bit more googling, and I was able to find a better RSS feed which I plopped into the Feed2JS code generator.

Now I'm a bit scared to search through my blog archives because I'm wondering if this is something I tried leaving myself a note about in the past.

No comments: