.sig File Upgrade: Variable Weather Reports

codesnip(tl/dr: Michael is a geek.)

For a very long time I’ve had a comment about the Miami weather in the last line of my email .sig file, something like “It’s hot here” or “It’s cool here” or occasionally “It’s @#$@#$ hot here.”  This started out largely as reaction against the pretentious .sig files I ran into surprisingly often in the early days of the net.  But it was also driven in part by our remarkable weather in Miami: way too hot six months of the year, lovely five months of the year, and pot luck on the balance.

I had imagined that the right way to do a .sig file modifier on a unix box would be to do something to the mailer daemon to instruct it to pull the weather data in real time.  But because my mail is on a university machine, I don’t have the privileges to do that, and even if I did I don’t think I’d mess with their mailer.

So for 20+ years I did the weather line by hand, changing the last line of my .sig file a few times a year to reflect the change in the seasons, at least when I remembered to do it.  And from  time to time I wished for something automated that would check the weather every time I sent an email.

This summer I finally broke down and took a few hours and wrote a little script that grabs weather data from a public source  and re-writes the text of my .sig file every hour based on the temperature and humidity.  It’s not elegant, but modifying the text of the saved version of the .sig file means I don’t have to tangle with the mailer itself. It also means I use a lot fewer system resources when sending mail, plus it limits my lookups of the weather data.

It shouldn’t have taken a few hours, but I had to learn about how to handle arrays in PHP, plus my data source was badly documented and somewhat inconsistent in what it returned.  Overall, a silly thing to do, yes, and rather late to the party, but I’m happy about it anyway.

This entry was posted in Internet, Miami, Personal. Bookmark the permalink.