Insomnia
I never had any reason to learn php… or any programming language for that matter… But I’ve always been a bit of a hack, and like to tinker, so when I found myself not being able to sleep for the past several days, I thought, due to my exposure now to WordPress, that I’d play around with a few things.
I thought it would be cool to be able to automagically mark the sites listed in my blogroll if they had updates within the past 24 hours… So I played with a simple function to read the rss feed of a WordPress site, and calculate the age of all the articles… Not sure if I’ll go much further on this considering that not everyone uses WordPress and it could be a veritable nightmare trying to generalize grabbing the date from various rss schemas…
The second thing I tried, and this could only come from a sleep deprived brain, was to write a function to do a rough calculation of the moon’s phase based upon the current date. Generally my insomnia follows the phases of the moon, so I think yesterday around 3am, I was curious what the current phase was… :-) Well I found an algorithim written and C, which nearly literally translated to php, and viola… I thought if I could find some opensource images, I’d write a little plugin for wordpress that would allow users to “stamp” their posts with the phase of the moon…
Anyway, if you’re curious about these silly functions I have published a new “page” on the site for me to test them: php tests.
