updog 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/updog +1 -1
  2. data/lib/updog.rb +3 -2
  3. metadata +4 -4
data/bin/updog CHANGED
@@ -1,3 +1,3 @@
1
1
  require 'updog'
2
2
 
3
- Updog.get_weather(ARGV[0])
3
+ Updog.get_weather(ARGV.join(' '))
data/lib/updog.rb CHANGED
@@ -1,11 +1,12 @@
1
1
  require "rubygems"
2
2
  require "nokogiri"
3
3
  require 'open-uri'
4
+ require 'cgi'
4
5
 
5
6
  module Updog
6
7
  def self.get_weather(area)
7
- url = "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query="
8
- document = Nokogiri::XML(open(url << area))
8
+ url = "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=#{CGI.escape(area)}"
9
+ document = Nokogiri::XML(open(url))
9
10
 
10
11
  qualitive = document.css('fcttext')
11
12
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: updog
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stephen Schor
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-09 00:00:00 -04:00
18
+ date: 2011-09-10 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency