Jump to content

Yet Another Weather Workflow


Recommended Posts

I couldn't find any forecast workflows that were quite to my liking, so I whipped one up that gets a forecast from forecast.io:

 

eTuONUQ.png

 

Note: requires at least Mavericks. Not tested on Yosemite.

 

Download: https://github.com/kejadlen/dark-sky.alfredworkflow/releases

GitHub: https://github.com/kejadlen/dark-sky.alfredworkflow

Edited by kejadlen
Updating to Dark Sky
Link to comment

@kejadlen

 

Its working at 99.9 % on Yosemite 10.10.1

 

The install instructions and getting the API keys all were very well written. No issues at all getting it setup in less than 5 minutes. I obviously compared it with other weather services to see if the correct data was being returned. Using the 2 locations, I am currently working at, it functions very well. The correct data and locations are displayed. 

 

The only issue, I saw and its minor in my opinion. If you type in a location and press enter it will take you to a web page. That page is not loading for me in the Aviator, Safari, Chrome, or Opera browsers.  It is however opening correctly in FireFox. 

 

So I was wondering ?  If its something that can be fixed. If not, its no huge deal for me. I just set up a rule in Choosy (browser chooser) to process the URL and send it to Firefox every time. ;)

 

Nice addition to my collection. 

 

 

ps. I said 99.9 % due to Safari is installed with all Macs and Firefox is an additional download. Also having said that most of us know how flakey Safari can be at times. Hence the reason for keeping multiple browsers around.  

Edited by thightower
Link to comment
  • 1 month later...

@thightower That behavior is really fascinating! The URL should be ""http://forecast.io/#/f/47.6062%2C-122.3321". This might be an Alfred bug, since the comma character should be unescaped within a fragment. (Although it looks like Firefox correctly handles this case anyway!)

Link to comment
  • 4 months later...

Can you describe what you're doing and what happens?

 

On entering "forecast" into Alfred, it should use your IP to do geolocation (using ipinfo.io) and automatically pull the weather for that location. The Google API is only used if you enter "forecast" with a location, like "forecast NYC".

Link to comment

hmm now it works... before there was no location found, just "," and when I clicked on the link I saw it was weather for new york...

 

Now I get Vienna correctly... will test some more tomorrow, not sure why it suddenly workd...

 

thank you for clarification regarding google key

Link to comment

Great workflow. Love the forecast details.

 

Unfortunately it doesn't work so smoothly for me because I connect to the Internet via a VPN. The workflow gives me the weather for the location of the VPN endpoint, not where I actually am (obviously).

 

It'd be great if I could set a default location (my computer doesn't move) instead of having to enter the location by hand each time.

Link to comment

Ironically enough, that functionality was taken out when I added IP geolocation. I'm planning on re-adding it, but in the meantime, you should be able to download 0.0.6 and use that instead with setting DEFAULT_LAT_LONG (ex: 13.23,-12.45) and DEFAULT_LOCATION (just used for the name of the location). Pretty much nothing else has changed between 0.0.7 and 0.0.6, so you won't be missing anything else (aside from a minor bugfix for opening the website in the browser).

Link to comment

Now I have problems again, location is not found:

 

Screen%20Shot%202015-05-31%20at%2019.14.

 

When I select it, it takes me to New York....

 

So yesterday it worked, now this issue I experienced in the start is coming again... maybe it cannot determine my location for some valid reason?

Link to comment

Fiddlesticks.

 

If, like me, you don't move around much, you could hardcode your location instead. It's a hack, but it'll get you your damn fine weather forecast for the right place until there's a non-hacky solution.
 
You could change line 49 of forecast.rb from: 

location = (query.empty?) ? Location.from_ip : Location.new(query)

 to: 

location = (query.empty?) ? Location.new("Wien", 48.2, 16.366667) : Location.new(query) 

Then if you don't specify a location, it will default to Vienna instead of an IP address-based location.

 

AFAIK, you can use "Wien" or "Vienna" or "Home" or "Daheim" or whatever for the first argument. Perhaps @kejadlen can clarify if that's actually okay or if I'm talking nonsense?

 

Also: lol @ "City: Austria" :D

Edited by deanishe
Link to comment
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...