Use Pythonista to Get Weather of Current Location into Drafts App

My quest began when I began using Drafts app (among many other ways) to keep a fishing log. I created a TextExpander fill-in snippet to quickly enter what (if anything) was caught, the date, the type of lure(s) used, etc. I really wanted to automate adding the weather conditions as well, but alas, my search for that solution turned up nothing…until yesterday.

It started when @drdrang shared a Pythonista script to leverage the location inside iOS. Later he shared another version, from @hiilppp.

Armed with that knowledge and a rudimentary knowledge of the forecast.io API, I set off to steal crib some Python usage of their API. Enter @jayhickey and his PySky script. While written for the v1 Dark Skies API, it gave me enough Python to convert to the new v2 of Forecast.io.

The result?

original gist

This version simply grabs the current weather summary and temperature from your current location, meant to be used with @draftsapp as a URL action pythonista : / / py_forecast?action=run&argv=[[draft]]. Dr. Drang suggests using New From Gist, however I had better success using iOctocat. There is an “open in…” dialog when viewing your gists or starred gists, and pick Pythonista.

Certainly for my fishing log I am expanding on this to include wind, sunrise and set times as well as the recently added moon phase. I figured a more generic version would be best shared, but please do not hesitate to leave a comment or ask me a question on Twitter @miklb. I’ll do my best to help, as I’m indebted to the aforementioned gents for sharing their code and helping in the first place.

Hurricane Wilma

hurricane flagsWell, well, well. 12th hurricane, 24th named storm, and this one could seriously have her eye on Tampa. As the computer models have her slightly lower than the Tampa area, the most recent discussion talks of some slightly different motion than previously forcast, and how the recent NOAA jet’s flight data would have on the models. Keep an eye out folks, it ain’t over yet.

Eery. Very Eery

NOLA.com: Hurricane CenterDon’t ask me why, but when looking at national news, I clicked on the bookmark for the Times Picayune…A front page void of news, with some prexisting links still there, I found this 5 part series link at the bottom of the page.

“A catastrophic hurricane represents 10 or 15 atomic bombs in terms of the energy it releases,” said Joseph Suhayda, a Louisiana State University engineer who is studying ways to limit hurricane damage in the New Orleans area.