Created
November 10, 2011 23:58
-
-
Save pgib/1356679 to your computer and use it in GitHub Desktop.
Get me some temperatures for screen's backtick!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
require 'rubygems' | |
# https://github.com/jnunemaker/google-weather/ | |
# gem install google-weather | |
require 'google_weather' | |
# usage: outside_temp.rb [City,Province|Postal Code] | |
if ARGV.size == 0 | |
city = "Vancouver,BC" | |
else | |
city = ARGV[0] | |
end | |
weather = GoogleWeather.new(city) | |
# I'd like to append ℃ or °, but screen seems to mangle Unicode? | |
puts "#{weather.current_conditions.temp_c}C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment