yahoo_weather 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -5
- data/lib/yahoo_weather/client.rb +20 -12
- data/lib/yahoo_weather/response.rb +16 -21
- data/lib/yahoo_weather/version.rb +1 -1
- data/lib/yahoo_weather.rb +1 -1
- data/test/dummy/log/test.log +455 -0
- data/test/dummy/tmp/cache/4BA/650/woeid+for+94025 +1 -0
- data/test/dummy/tmp/cache/786/890/yahoo_weather_10001_f +0 -0
- data/test/dummy/tmp/cache/7FF/F00/yahoo_weather_2459115_f +1 -0
- data/test/dummy/tmp/cache/831/AD0/yahoo_weather_12761336_f +56 -0
- data/test/dummy/tmp/cache/838/DA0/yahoo_weather_12797118_f +56 -0
- data/test/dummy/tmp/cache/83D/EE0/yahoo_weather_12797168_f +1 -56
- data/test/dummy/tmp/cache/A79/3C0/yahoo_weather_woeid+for+10004 +1 -0
- data/test/dummy/tmp/cache/C7E/C30/yahoo_weather_woeid+for+New+York +1 -0
- data/test/yahoo_weather_test.rb +0 -14
- data/yahoo_weather.gemspec +0 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5aae68afc9d6e428f1299812135beabffbb9ea0e
|
4
|
+
data.tar.gz: 78ba751ee167362aec08907889eb5570db2f8207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f656a1e6d27e370be7a209a2bd991bf9cc21cdd06c702de1fa9263d69b8b8b42d029be3494fe1bfcf9c7795f519059ae0914ac78f8f4e63f4bfebae1ca1ad818
|
7
|
+
data.tar.gz: 9bd1bc0cfbca1790897f3a08a1af2f2e838f4855230abdd678b7f5a2240a6aa9d1df1ad7d1aac1d5c26fb76ed8e9f4efe1952b7f60f5ced469b1f2677da9349c
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yahoo_weather (1.0
|
5
|
-
nokogiri
|
4
|
+
yahoo_weather (1.1.0)
|
6
5
|
rails (>= 3.1.0)
|
7
6
|
|
8
7
|
GEM
|
@@ -43,11 +42,8 @@ GEM
|
|
43
42
|
mime-types (~> 1.16)
|
44
43
|
treetop (~> 1.4.8)
|
45
44
|
mime-types (1.25)
|
46
|
-
mini_portile (0.5.1)
|
47
45
|
minitest (4.7.5)
|
48
46
|
multi_json (1.8.0)
|
49
|
-
nokogiri (1.6.0)
|
50
|
-
mini_portile (~> 0.5.0)
|
51
47
|
polyglot (0.3.3)
|
52
48
|
rack (1.5.2)
|
53
49
|
rack-test (0.6.2)
|
data/lib/yahoo_weather/client.rb
CHANGED
@@ -4,18 +4,26 @@ class YahooWeather::Client
|
|
4
4
|
def fetch(woeid, units = YahooWeather::Units::FAHRENHEIT)
|
5
5
|
@units = units
|
6
6
|
@woeid = woeid
|
7
|
-
doc =
|
8
|
-
|
7
|
+
doc = JSON(read_json)
|
8
|
+
if doc['query']['count'] > 0
|
9
|
+
YahooWeather::Response.new(doc)
|
10
|
+
else
|
11
|
+
nil
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
15
|
def fetch_by_location(location, units = YahooWeather::Units::FAHRENHEIT)
|
12
|
-
woeid_cache_key = "
|
16
|
+
woeid_cache_key = "yahoo_weather_woeid for #{location}"
|
13
17
|
unless Rails.cache.exist? woeid_cache_key
|
14
|
-
url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%22#{::CGI.escape(location)}%22
|
15
|
-
|
16
|
-
doc =
|
17
|
-
|
18
|
-
|
18
|
+
url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%22#{::CGI.escape(location)}%22&format=json&callback="
|
19
|
+
json = fetch_json(url)
|
20
|
+
doc = JSON(json)
|
21
|
+
if doc['query']['count'] > 0
|
22
|
+
woeid = doc['query']['results']['Result']['woeid']
|
23
|
+
Rails.cache.write(woeid_cache_key, woeid)
|
24
|
+
else
|
25
|
+
return nil
|
26
|
+
end
|
19
27
|
else
|
20
28
|
woeid = Rails.cache.read woeid_cache_key
|
21
29
|
end
|
@@ -26,15 +34,15 @@ class YahooWeather::Client
|
|
26
34
|
|
27
35
|
private
|
28
36
|
def get_url
|
29
|
-
"http://
|
37
|
+
"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D#{@woeid}%20and%20u%3D%22#{@units}%22&format=json&callback="
|
30
38
|
end
|
31
39
|
|
32
|
-
def
|
40
|
+
def read_json
|
33
41
|
save_cache unless Rails.cache.exist? cache_key
|
34
42
|
read_cache
|
35
43
|
end
|
36
44
|
|
37
|
-
def
|
45
|
+
def fetch_json(url = get_url)
|
38
46
|
begin
|
39
47
|
response = open(url)
|
40
48
|
rescue OpenURI::HTTPError => e
|
@@ -45,7 +53,7 @@ private
|
|
45
53
|
end
|
46
54
|
|
47
55
|
def save_cache
|
48
|
-
Rails.cache.write(cache_key,
|
56
|
+
Rails.cache.write(cache_key, fetch_json, expires_in: 1.minute)
|
49
57
|
end
|
50
58
|
|
51
59
|
def read_cache
|
@@ -4,51 +4,46 @@ class YahooWeather::Response
|
|
4
4
|
:lat, :long
|
5
5
|
|
6
6
|
def initialize(doc)
|
7
|
-
@doc = doc
|
8
|
-
@title =
|
9
|
-
@link =
|
10
|
-
@description =
|
11
|
-
@language =
|
12
|
-
@last_build_date = Time.parse(
|
13
|
-
@ttl =
|
14
|
-
@lat =
|
15
|
-
@long =
|
7
|
+
@doc = doc['query']['results']['channel']
|
8
|
+
@title = @doc['item']['title']
|
9
|
+
@link = @doc['link']
|
10
|
+
@description = @doc['description']
|
11
|
+
@language = @doc['language']
|
12
|
+
@last_build_date = Time.parse(@doc['lastBuildDate'])
|
13
|
+
@ttl = @doc['ttl'].to_i
|
14
|
+
@lat = @doc['item']['lat'].to_f
|
15
|
+
@long = @doc['item']['long'].to_f
|
16
16
|
end
|
17
17
|
|
18
18
|
def location
|
19
|
-
YahooWeather::Location.new(@doc
|
19
|
+
YahooWeather::Location.new(@doc['location'])
|
20
20
|
end
|
21
21
|
|
22
22
|
def units
|
23
|
-
YahooWeather::Units.new(@doc
|
23
|
+
YahooWeather::Units.new(@doc['units'])
|
24
24
|
end
|
25
25
|
|
26
26
|
def astronomy
|
27
|
-
YahooWeather::Astronomy.new(@doc
|
27
|
+
YahooWeather::Astronomy.new(@doc['astronomy'])
|
28
28
|
end
|
29
29
|
|
30
30
|
def atmosphere
|
31
|
-
YahooWeather::Atmosphere.new(@doc
|
31
|
+
YahooWeather::Atmosphere.new(@doc['atmosphere'])
|
32
32
|
end
|
33
33
|
|
34
34
|
def condition
|
35
|
-
YahooWeather::Condition.new(@doc
|
35
|
+
YahooWeather::Condition.new(@doc['item']['condition'])
|
36
36
|
end
|
37
37
|
|
38
38
|
def wind
|
39
|
-
YahooWeather::Wind.new(@doc
|
39
|
+
YahooWeather::Wind.new(@doc['wind'])
|
40
40
|
end
|
41
41
|
|
42
42
|
def forecasts
|
43
43
|
forecasts = []
|
44
|
-
@doc
|
44
|
+
@doc['item']['forecast'].each do |forecast|
|
45
45
|
forecasts << YahooWeather::Forecast.new(forecast)
|
46
46
|
end
|
47
47
|
forecasts
|
48
48
|
end
|
49
|
-
|
50
|
-
private
|
51
|
-
def get_text(tag_name)
|
52
|
-
@doc.at(tag_name).children.text
|
53
|
-
end
|
54
49
|
end
|
data/lib/yahoo_weather.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -381,5 +381,460 @@ YahooWeatherTest: test_Units
|
|
381
381
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
382
382
|
---------------------------
|
383
383
|
YahooWeatherTest: test_Wind
|
384
|
+
---------------------------
|
385
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
386
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
387
|
+
--------------------------------
|
388
|
+
YahooWeatherTest: test_Astronomy
|
389
|
+
--------------------------------
|
390
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
391
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
392
|
+
---------------------------------
|
393
|
+
YahooWeatherTest: test_Atmosphere
|
394
|
+
---------------------------------
|
395
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
396
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
397
|
+
--------------------------------
|
398
|
+
YahooWeatherTest: test_Condition
|
399
|
+
--------------------------------
|
400
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
401
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
402
|
+
-------------------------------------
|
403
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
404
|
+
-------------------------------------
|
405
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
406
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
407
|
+
--------------------------------------------------
|
408
|
+
YahooWeatherTest: test_Fetch_with_the_bad_response
|
409
|
+
--------------------------------------------------
|
410
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
411
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
412
|
+
--------------------------------
|
413
|
+
YahooWeatherTest: test_Forecasts
|
414
|
+
--------------------------------
|
415
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
416
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
417
|
+
------------------------------
|
418
|
+
YahooWeatherTest: test_General
|
419
|
+
------------------------------
|
420
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
421
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
422
|
+
-------------------------------
|
423
|
+
YahooWeatherTest: test_Location
|
424
|
+
-------------------------------
|
425
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
426
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
427
|
+
---------------------------------------
|
428
|
+
YahooWeatherTest: test_Success_response
|
429
|
+
---------------------------------------
|
430
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
431
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
432
|
+
----------------------------
|
433
|
+
YahooWeatherTest: test_Units
|
434
|
+
----------------------------
|
435
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
436
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
437
|
+
---------------------------
|
438
|
+
YahooWeatherTest: test_Wind
|
439
|
+
---------------------------
|
440
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
441
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
442
|
+
--------------------------------
|
443
|
+
YahooWeatherTest: test_Astronomy
|
444
|
+
--------------------------------
|
445
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
446
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
447
|
+
---------------------------------
|
448
|
+
YahooWeatherTest: test_Atmosphere
|
449
|
+
---------------------------------
|
450
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
451
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
452
|
+
--------------------------------
|
453
|
+
YahooWeatherTest: test_Condition
|
454
|
+
--------------------------------
|
455
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
456
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
457
|
+
-------------------------------------
|
458
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
459
|
+
-------------------------------------
|
460
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
461
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
462
|
+
--------------------------------
|
463
|
+
YahooWeatherTest: test_Forecasts
|
464
|
+
--------------------------------
|
465
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
466
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
467
|
+
------------------------------
|
468
|
+
YahooWeatherTest: test_General
|
469
|
+
------------------------------
|
470
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
471
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
472
|
+
-------------------------------
|
473
|
+
YahooWeatherTest: test_Location
|
474
|
+
-------------------------------
|
475
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
476
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
477
|
+
---------------------------------------
|
478
|
+
YahooWeatherTest: test_Success_response
|
479
|
+
---------------------------------------
|
480
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
481
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
482
|
+
----------------------------
|
483
|
+
YahooWeatherTest: test_Units
|
484
|
+
----------------------------
|
485
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
486
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
487
|
+
---------------------------
|
488
|
+
YahooWeatherTest: test_Wind
|
489
|
+
---------------------------
|
490
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
491
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
492
|
+
--------------------------------
|
493
|
+
YahooWeatherTest: test_Astronomy
|
494
|
+
--------------------------------
|
495
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
496
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
497
|
+
---------------------------------
|
498
|
+
YahooWeatherTest: test_Atmosphere
|
499
|
+
---------------------------------
|
500
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
501
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
502
|
+
--------------------------------
|
503
|
+
YahooWeatherTest: test_Condition
|
504
|
+
--------------------------------
|
505
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
506
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
507
|
+
-------------------------------------
|
508
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
509
|
+
-------------------------------------
|
510
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
511
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
512
|
+
--------------------------------
|
513
|
+
YahooWeatherTest: test_Forecasts
|
514
|
+
--------------------------------
|
515
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
516
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
517
|
+
------------------------------
|
518
|
+
YahooWeatherTest: test_General
|
519
|
+
------------------------------
|
520
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
521
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
522
|
+
-------------------------------
|
523
|
+
YahooWeatherTest: test_Location
|
524
|
+
-------------------------------
|
525
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
526
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
527
|
+
---------------------------------------
|
528
|
+
YahooWeatherTest: test_Success_response
|
529
|
+
---------------------------------------
|
530
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
531
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
532
|
+
----------------------------
|
533
|
+
YahooWeatherTest: test_Units
|
534
|
+
----------------------------
|
535
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
536
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
537
|
+
---------------------------
|
538
|
+
YahooWeatherTest: test_Wind
|
539
|
+
---------------------------
|
540
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
541
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
542
|
+
--------------------------------
|
543
|
+
YahooWeatherTest: test_Astronomy
|
544
|
+
--------------------------------
|
545
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
546
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
547
|
+
---------------------------------
|
548
|
+
YahooWeatherTest: test_Atmosphere
|
549
|
+
---------------------------------
|
550
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
551
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
552
|
+
--------------------------------
|
553
|
+
YahooWeatherTest: test_Condition
|
554
|
+
--------------------------------
|
555
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
556
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
557
|
+
-------------------------------------
|
558
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
559
|
+
-------------------------------------
|
560
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
561
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
562
|
+
--------------------------------
|
563
|
+
YahooWeatherTest: test_Forecasts
|
564
|
+
--------------------------------
|
565
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
566
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
567
|
+
------------------------------
|
568
|
+
YahooWeatherTest: test_General
|
569
|
+
------------------------------
|
570
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
571
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
572
|
+
-------------------------------
|
573
|
+
YahooWeatherTest: test_Location
|
574
|
+
-------------------------------
|
575
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
576
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
577
|
+
---------------------------------------
|
578
|
+
YahooWeatherTest: test_Success_response
|
579
|
+
---------------------------------------
|
580
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
581
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
582
|
+
----------------------------
|
583
|
+
YahooWeatherTest: test_Units
|
584
|
+
----------------------------
|
585
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
586
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
587
|
+
---------------------------
|
588
|
+
YahooWeatherTest: test_Wind
|
589
|
+
---------------------------
|
590
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
591
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
592
|
+
--------------------------------
|
593
|
+
YahooWeatherTest: test_Astronomy
|
594
|
+
--------------------------------
|
595
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
596
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
597
|
+
---------------------------------
|
598
|
+
YahooWeatherTest: test_Atmosphere
|
599
|
+
---------------------------------
|
600
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
601
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
602
|
+
--------------------------------
|
603
|
+
YahooWeatherTest: test_Condition
|
604
|
+
--------------------------------
|
605
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
606
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
607
|
+
-------------------------------------
|
608
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
609
|
+
-------------------------------------
|
610
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
611
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
612
|
+
--------------------------------
|
613
|
+
YahooWeatherTest: test_Forecasts
|
614
|
+
--------------------------------
|
615
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
616
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
617
|
+
------------------------------
|
618
|
+
YahooWeatherTest: test_General
|
619
|
+
------------------------------
|
620
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
621
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
622
|
+
-------------------------------
|
623
|
+
YahooWeatherTest: test_Location
|
624
|
+
-------------------------------
|
625
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
626
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
627
|
+
---------------------------------------
|
628
|
+
YahooWeatherTest: test_Success_response
|
629
|
+
---------------------------------------
|
630
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
631
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
632
|
+
----------------------------
|
633
|
+
YahooWeatherTest: test_Units
|
634
|
+
----------------------------
|
635
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
636
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
637
|
+
---------------------------
|
638
|
+
YahooWeatherTest: test_Wind
|
639
|
+
---------------------------
|
640
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
641
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
642
|
+
--------------------------------
|
643
|
+
YahooWeatherTest: test_Astronomy
|
644
|
+
--------------------------------
|
645
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
646
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
647
|
+
---------------------------------
|
648
|
+
YahooWeatherTest: test_Atmosphere
|
649
|
+
---------------------------------
|
650
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
651
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
652
|
+
--------------------------------
|
653
|
+
YahooWeatherTest: test_Condition
|
654
|
+
--------------------------------
|
655
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
656
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
657
|
+
-------------------------------------
|
658
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
659
|
+
-------------------------------------
|
660
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
661
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
662
|
+
--------------------------------
|
663
|
+
YahooWeatherTest: test_Forecasts
|
664
|
+
--------------------------------
|
665
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
666
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
667
|
+
------------------------------
|
668
|
+
YahooWeatherTest: test_General
|
669
|
+
------------------------------
|
670
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
671
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
672
|
+
-------------------------------
|
673
|
+
YahooWeatherTest: test_Location
|
674
|
+
-------------------------------
|
675
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
676
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
677
|
+
---------------------------------------
|
678
|
+
YahooWeatherTest: test_Success_response
|
679
|
+
---------------------------------------
|
680
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
681
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
682
|
+
----------------------------
|
683
|
+
YahooWeatherTest: test_Units
|
684
|
+
----------------------------
|
685
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
686
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
687
|
+
---------------------------
|
688
|
+
YahooWeatherTest: test_Wind
|
689
|
+
---------------------------
|
690
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
691
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
692
|
+
--------------------------------
|
693
|
+
YahooWeatherTest: test_Astronomy
|
694
|
+
--------------------------------
|
695
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
696
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
697
|
+
---------------------------------
|
698
|
+
YahooWeatherTest: test_Atmosphere
|
699
|
+
---------------------------------
|
700
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
701
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
702
|
+
--------------------------------
|
703
|
+
YahooWeatherTest: test_Condition
|
704
|
+
--------------------------------
|
705
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
706
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
707
|
+
-------------------------------------
|
708
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
709
|
+
-------------------------------------
|
710
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
711
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
712
|
+
--------------------------------
|
713
|
+
YahooWeatherTest: test_Forecasts
|
714
|
+
--------------------------------
|
715
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
716
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
717
|
+
------------------------------
|
718
|
+
YahooWeatherTest: test_General
|
719
|
+
------------------------------
|
720
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
721
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
722
|
+
-------------------------------
|
723
|
+
YahooWeatherTest: test_Location
|
724
|
+
-------------------------------
|
725
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
726
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
727
|
+
---------------------------------------
|
728
|
+
YahooWeatherTest: test_Success_response
|
729
|
+
---------------------------------------
|
730
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
731
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
732
|
+
----------------------------
|
733
|
+
YahooWeatherTest: test_Units
|
734
|
+
----------------------------
|
735
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
736
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
737
|
+
---------------------------
|
738
|
+
YahooWeatherTest: test_Wind
|
739
|
+
---------------------------
|
740
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
741
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
742
|
+
--------------------------------
|
743
|
+
YahooWeatherTest: test_Astronomy
|
744
|
+
--------------------------------
|
745
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
746
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
747
|
+
---------------------------------
|
748
|
+
YahooWeatherTest: test_Atmosphere
|
749
|
+
---------------------------------
|
750
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
751
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
752
|
+
--------------------------------
|
753
|
+
YahooWeatherTest: test_Condition
|
754
|
+
--------------------------------
|
755
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
756
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
757
|
+
-------------------------------------
|
758
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
759
|
+
-------------------------------------
|
760
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
761
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
762
|
+
--------------------------------
|
763
|
+
YahooWeatherTest: test_Forecasts
|
764
|
+
--------------------------------
|
765
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
766
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
767
|
+
------------------------------
|
768
|
+
YahooWeatherTest: test_General
|
769
|
+
------------------------------
|
770
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
771
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
772
|
+
-------------------------------
|
773
|
+
YahooWeatherTest: test_Location
|
774
|
+
-------------------------------
|
775
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
776
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
777
|
+
---------------------------------------
|
778
|
+
YahooWeatherTest: test_Success_response
|
779
|
+
---------------------------------------
|
780
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
781
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
782
|
+
----------------------------
|
783
|
+
YahooWeatherTest: test_Units
|
784
|
+
----------------------------
|
785
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
786
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
787
|
+
---------------------------
|
788
|
+
YahooWeatherTest: test_Wind
|
789
|
+
---------------------------
|
790
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
791
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
792
|
+
--------------------------------
|
793
|
+
YahooWeatherTest: test_Astronomy
|
794
|
+
--------------------------------
|
795
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
796
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
797
|
+
---------------------------------
|
798
|
+
YahooWeatherTest: test_Atmosphere
|
799
|
+
---------------------------------
|
800
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
801
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
802
|
+
--------------------------------
|
803
|
+
YahooWeatherTest: test_Condition
|
804
|
+
--------------------------------
|
805
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
806
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
807
|
+
-------------------------------------
|
808
|
+
YahooWeatherTest: test_Fetch_by_WOEID
|
809
|
+
-------------------------------------
|
810
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
811
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
812
|
+
--------------------------------
|
813
|
+
YahooWeatherTest: test_Forecasts
|
814
|
+
--------------------------------
|
815
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
816
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
817
|
+
------------------------------
|
818
|
+
YahooWeatherTest: test_General
|
819
|
+
------------------------------
|
820
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
821
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
822
|
+
-------------------------------
|
823
|
+
YahooWeatherTest: test_Location
|
824
|
+
-------------------------------
|
825
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
826
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
827
|
+
---------------------------------------
|
828
|
+
YahooWeatherTest: test_Success_response
|
829
|
+
---------------------------------------
|
830
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
831
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
832
|
+
----------------------------
|
833
|
+
YahooWeatherTest: test_Units
|
834
|
+
----------------------------
|
835
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
836
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
837
|
+
---------------------------
|
838
|
+
YahooWeatherTest: test_Wind
|
384
839
|
---------------------------
|
385
840
|
[1m[35m (0.1ms)[0m rollback transaction
|
@@ -0,0 +1 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry:@valueI"
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry:@valueI"4 {"query":{"count":1,"created":"2013-09-14T07:40:03Z","lang":"en-US","results":{"channel":{"title":"Yahoo! Weather - New York, NY","link":"http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html","description":"Yahoo! Weather for New York, NY","language":"en-us","lastBuildDate":"Sat, 14 Sep 2013 2:49 am EDT","ttl":"60","location":{"city":"New York","country":"United States","region":"NY"},"units":{"distance":"mi","pressure":"in","speed":"mph","temperature":"F"},"wind":{"chill":"57","direction":"310","speed":"7"},"atmosphere":{"humidity":"64","pressure":"29.92","rising":"1","visibility":"10"},"astronomy":{"sunrise":"6:33 am","sunset":"7:06 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions for New York, NY at 2:49 am EDT","lat":"40.71","long":"-74.01","link":"http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html","pubDate":"Sat, 14 Sep 2013 2:49 am EDT","condition":{"code":"33","date":"Sat, 14 Sep 2013 2:49 am EDT","temp":"57","text":"Fair"},"description":"\n<img src=\"http://l.yimg.com/a/i/us/we/52/33.gif\"/><br />\n<b>Current Conditions:</b><br />\nFair, 57 F<BR />\n<BR /><b>Forecast:</b><BR />\nSat - Mostly Sunny. High: 72 Low: 52<br />\nSun - Mostly Sunny. High: 75 Low: 61<br />\nMon - Showers. High: 71 Low: 53<br />\nTue - Sunny. High: 70 Low: 53<br />\nWed - Sunny. High: 73 Low: 57<br />\n<br />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html\">Full Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"http://www.weather.com\" >The Weather Channel</a>)<br/>\n","forecast":[{"code":"34","date":"14 Sep 2013","day":"Sat","high":"72","low":"52","text":"Mostly Sunny"},{"code":"34","date":"15 Sep 2013","day":"Sun","high":"75","low":"61","text":"Mostly Sunny"},{"code":"11","date":"16 Sep 2013","day":"Mon","high":"71","low":"53","text":"Showers"},{"code":"32","date":"17 Sep 2013","day":"Tue","high":"70","low":"53","text":"Sunny"},{"code":"32","date":"18 Sep 2013","day":"Wed","high":"73","low":"57","text":"Sunny"}],"guid":{"isPermaLink":"false","content":"USNY0996_2013_09_18_7_00_EDT"}}}}}}:ET:@created_atf1379144406.273215:@expires_inf6e1
|
@@ -0,0 +1,56 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry:@valueI"�
|
2
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
3
|
+
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
|
4
|
+
<channel>
|
5
|
+
|
6
|
+
<title>Yahoo! Weather - New York, NY</title>
|
7
|
+
<link>http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html</link>
|
8
|
+
<description>Yahoo! Weather for New York, NY</description>
|
9
|
+
<language>en-us</language>
|
10
|
+
<lastBuildDate>Sat, 14 Sep 2013 1:49 am EDT</lastBuildDate>
|
11
|
+
<ttl>60</ttl>
|
12
|
+
<yweather:location city="New York" region="NY" country="United States"/>
|
13
|
+
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
|
14
|
+
<yweather:wind chill="58" direction="0" speed="3" />
|
15
|
+
<yweather:atmosphere humidity="62" visibility="10" pressure="29.91" rising="1" />
|
16
|
+
<yweather:astronomy sunrise="6:33 am" sunset="7:06 pm"/>
|
17
|
+
<image>
|
18
|
+
<title>Yahoo! Weather</title>
|
19
|
+
<width>142</width>
|
20
|
+
<height>18</height>
|
21
|
+
<link>http://weather.yahoo.com</link>
|
22
|
+
<url>http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif</url>
|
23
|
+
</image>
|
24
|
+
<item>
|
25
|
+
<title>Conditions for New York, NY at 1:49 am EDT</title>
|
26
|
+
<geo:lat>40.69</geo:lat>
|
27
|
+
<geo:long>-74.02</geo:long>
|
28
|
+
<link>http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html</link>
|
29
|
+
<pubDate>Sat, 14 Sep 2013 1:49 am EDT</pubDate>
|
30
|
+
<yweather:condition text="Fair" code="33" temp="58" date="Sat, 14 Sep 2013 1:49 am EDT" />
|
31
|
+
<description><![CDATA[
|
32
|
+
<img src="http://l.yimg.com/a/i/us/we/52/33.gif"/><br />
|
33
|
+
<b>Current Conditions:</b><br />
|
34
|
+
Fair, 58 F<BR />
|
35
|
+
<BR /><b>Forecast:</b><BR />
|
36
|
+
Fri - Clear. High: 74 Low: 54<br />
|
37
|
+
Sat - Sunny. High: 72 Low: 52<br />
|
38
|
+
Sun - Partly Cloudy. High: 75 Low: 61<br />
|
39
|
+
Mon - Showers. High: 71 Low: 53<br />
|
40
|
+
Tue - Sunny. High: 70 Low: 53<br />
|
41
|
+
<br />
|
42
|
+
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
|
43
|
+
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
|
44
|
+
]]></description>
|
45
|
+
<yweather:forecast day="Fri" date="13 Sep 2013" low="54" high="74" text="Clear" code="31" />
|
46
|
+
<yweather:forecast day="Sat" date="14 Sep 2013" low="52" high="72" text="Sunny" code="32" />
|
47
|
+
<yweather:forecast day="Sun" date="15 Sep 2013" low="61" high="75" text="Partly Cloudy" code="30" />
|
48
|
+
<yweather:forecast day="Mon" date="16 Sep 2013" low="53" high="71" text="Showers" code="11" />
|
49
|
+
<yweather:forecast day="Tue" date="17 Sep 2013" low="53" high="70" text="Sunny" code="32" />
|
50
|
+
<guid isPermaLink="false">USNY0996_2013_09_17_7_00_EDT</guid>
|
51
|
+
</item>
|
52
|
+
</channel>
|
53
|
+
</rss>
|
54
|
+
|
55
|
+
<!-- api5.weather.sg3.yahoo.com Sat Sep 14 06:33:40 PST 2013 -->
|
56
|
+
:ET:@created_atf1379140425.031191:@expires_inf6e1
|
@@ -0,0 +1,56 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry:@valueI"�
|
2
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
3
|
+
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
|
4
|
+
<channel>
|
5
|
+
|
6
|
+
<title>Yahoo! Weather - Atherton, CA</title>
|
7
|
+
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Atherton__CA/*http://weather.yahoo.com/forecast/USCA0050_f.html</link>
|
8
|
+
<description>Yahoo! Weather for Atherton, CA</description>
|
9
|
+
<language>en-us</language>
|
10
|
+
<lastBuildDate>Fri, 13 Sep 2013 8:46 pm PDT</lastBuildDate>
|
11
|
+
<ttl>60</ttl>
|
12
|
+
<yweather:location city="Atherton" region="CA" country="United States"/>
|
13
|
+
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
|
14
|
+
<yweather:wind chill="61" direction="350" speed="10" />
|
15
|
+
<yweather:atmosphere humidity="88" visibility="10" pressure="29.8" rising="0" />
|
16
|
+
<yweather:astronomy sunrise="6:48 am" sunset="7:19 pm"/>
|
17
|
+
<image>
|
18
|
+
<title>Yahoo! Weather</title>
|
19
|
+
<width>142</width>
|
20
|
+
<height>18</height>
|
21
|
+
<link>http://weather.yahoo.com</link>
|
22
|
+
<url>http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif</url>
|
23
|
+
</image>
|
24
|
+
<item>
|
25
|
+
<title>Conditions for Atherton, CA at 8:46 pm PDT</title>
|
26
|
+
<geo:lat>37.45</geo:lat>
|
27
|
+
<geo:long>-122.21</geo:long>
|
28
|
+
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Atherton__CA/*http://weather.yahoo.com/forecast/USCA0050_f.html</link>
|
29
|
+
<pubDate>Fri, 13 Sep 2013 8:46 pm PDT</pubDate>
|
30
|
+
<yweather:condition text="Partly Cloudy" code="29" temp="61" date="Fri, 13 Sep 2013 8:46 pm PDT" />
|
31
|
+
<description><![CDATA[
|
32
|
+
<img src="http://l.yimg.com/a/i/us/we/52/29.gif"/><br />
|
33
|
+
<b>Current Conditions:</b><br />
|
34
|
+
Partly Cloudy, 61 F<BR />
|
35
|
+
<BR /><b>Forecast:</b><BR />
|
36
|
+
Fri - Mostly Cloudy. High: 74 Low: 56<br />
|
37
|
+
Sat - AM Clouds/PM Sun. High: 78 Low: 56<br />
|
38
|
+
Sun - AM Clouds/PM Sun. High: 78 Low: 56<br />
|
39
|
+
Mon - Sunny. High: 80 Low: 55<br />
|
40
|
+
Tue - Sunny. High: 80 Low: 55<br />
|
41
|
+
<br />
|
42
|
+
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Atherton__CA/*http://weather.yahoo.com/forecast/USCA0050_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
|
43
|
+
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
|
44
|
+
]]></description>
|
45
|
+
<yweather:forecast day="Fri" date="13 Sep 2013" low="56" high="74" text="Mostly Cloudy" code="27" />
|
46
|
+
<yweather:forecast day="Sat" date="14 Sep 2013" low="56" high="78" text="AM Clouds/PM Sun" code="30" />
|
47
|
+
<yweather:forecast day="Sun" date="15 Sep 2013" low="56" high="78" text="AM Clouds/PM Sun" code="30" />
|
48
|
+
<yweather:forecast day="Mon" date="16 Sep 2013" low="55" high="80" text="Sunny" code="32" />
|
49
|
+
<yweather:forecast day="Tue" date="17 Sep 2013" low="55" high="80" text="Sunny" code="32" />
|
50
|
+
<guid isPermaLink="false">USCA0050_2013_09_17_7_00_PDT</guid>
|
51
|
+
</item>
|
52
|
+
</channel>
|
53
|
+
</rss>
|
54
|
+
|
55
|
+
<!-- api6.weather.gq1.yahoo.com Sat Sep 14 06:18:14 PST 2013 -->
|
56
|
+
:ET:@created_atf1379139499.611135:@expires_inf6e1
|
@@ -1,56 +1 @@
|
|
1
|
-
o: ActiveSupport::Cache::Entry:@valueI"
|
2
|
-
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
3
|
-
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
|
4
|
-
<channel>
|
5
|
-
|
6
|
-
<title>Yahoo! Weather - San Francisco, CA</title>
|
7
|
-
<link>http://us.rd.yahoo.com/dailynews/rss/weather/San_Francisco__CA/*http://weather.yahoo.com/forecast/USCA0987_f.html</link>
|
8
|
-
<description>Yahoo! Weather for San Francisco, CA</description>
|
9
|
-
<language>en-us</language>
|
10
|
-
<lastBuildDate>Fri, 13 Sep 2013 10:52 pm PDT</lastBuildDate>
|
11
|
-
<ttl>60</ttl>
|
12
|
-
<yweather:location city="San Francisco" region="CA" country="United States"/>
|
13
|
-
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
|
14
|
-
<yweather:wind chill="59" direction="260" speed="13" />
|
15
|
-
<yweather:atmosphere humidity="100" visibility="10" pressure="29.83" rising="1" />
|
16
|
-
<yweather:astronomy sunrise="6:48 am" sunset="7:19 pm"/>
|
17
|
-
<image>
|
18
|
-
<title>Yahoo! Weather</title>
|
19
|
-
<width>142</width>
|
20
|
-
<height>18</height>
|
21
|
-
<link>http://weather.yahoo.com</link>
|
22
|
-
<url>http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif</url>
|
23
|
-
</image>
|
24
|
-
<item>
|
25
|
-
<title>Conditions for San Francisco, CA at 10:52 pm PDT</title>
|
26
|
-
<geo:lat>37.78</geo:lat>
|
27
|
-
<geo:long>-122.46</geo:long>
|
28
|
-
<link>http://us.rd.yahoo.com/dailynews/rss/weather/San_Francisco__CA/*http://weather.yahoo.com/forecast/USCA0987_f.html</link>
|
29
|
-
<pubDate>Fri, 13 Sep 2013 10:52 pm PDT</pubDate>
|
30
|
-
<yweather:condition text="Cloudy" code="26" temp="59" date="Fri, 13 Sep 2013 10:52 pm PDT" />
|
31
|
-
<description><![CDATA[
|
32
|
-
<img src="http://l.yimg.com/a/i/us/we/52/26.gif"/><br />
|
33
|
-
<b>Current Conditions:</b><br />
|
34
|
-
Cloudy, 59 F<BR />
|
35
|
-
<BR /><b>Forecast:</b><BR />
|
36
|
-
Fri - Mostly Cloudy. High: 65 Low: 57<br />
|
37
|
-
Sat - AM Clouds/PM Sun. High: 66 Low: 58<br />
|
38
|
-
Sun - AM Clouds/PM Sun. High: 66 Low: 59<br />
|
39
|
-
Mon - Partly Cloudy. High: 69 Low: 58<br />
|
40
|
-
Tue - Sunny. High: 70 Low: 57<br />
|
41
|
-
<br />
|
42
|
-
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/San_Francisco__CA/*http://weather.yahoo.com/forecast/USCA0987_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
|
43
|
-
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
|
44
|
-
]]></description>
|
45
|
-
<yweather:forecast day="Fri" date="13 Sep 2013" low="57" high="65" text="Mostly Cloudy" code="27" />
|
46
|
-
<yweather:forecast day="Sat" date="14 Sep 2013" low="58" high="66" text="AM Clouds/PM Sun" code="30" />
|
47
|
-
<yweather:forecast day="Sun" date="15 Sep 2013" low="59" high="66" text="AM Clouds/PM Sun" code="30" />
|
48
|
-
<yweather:forecast day="Mon" date="16 Sep 2013" low="58" high="69" text="Partly Cloudy" code="30" />
|
49
|
-
<yweather:forecast day="Tue" date="17 Sep 2013" low="57" high="70" text="Sunny" code="32" />
|
50
|
-
<guid isPermaLink="false">USCA0987_2013_09_17_7_00_PDT</guid>
|
51
|
-
</item>
|
52
|
-
</channel>
|
53
|
-
</rss>
|
54
|
-
|
55
|
-
<!-- api18.weather.gq1.yahoo.com Sat Sep 14 06:09:50 PST 2013 -->
|
56
|
-
:ET:@created_atf1379139267.966285:@expires_inf6e1
|
1
|
+
o: ActiveSupport::Cache::Entry:@valueI"t {"query":{"count":1,"created":"2013-09-14T07:44:12Z","lang":"en-US","results":{"channel":{"title":"Yahoo! Weather - San Francisco, CA","link":"http://us.rd.yahoo.com/dailynews/rss/weather/San_Francisco__CA/*http://weather.yahoo.com/forecast/USCA0987_f.html","description":"Yahoo! Weather for San Francisco, CA","language":"en-us","lastBuildDate":"Fri, 13 Sep 2013 11:52 pm PDT","ttl":"60","location":{"city":"San Francisco","country":"United States","region":"CA"},"units":{"distance":"mi","pressure":"in","speed":"mph","temperature":"F"},"wind":{"chill":"59","direction":"280","speed":"13"},"atmosphere":{"humidity":"100","pressure":"29.82","rising":"2","visibility":"10"},"astronomy":{"sunrise":"6:48 am","sunset":"7:19 pm"},"image":{"title":"Yahoo! Weather","width":"142","height":"18","link":"http://weather.yahoo.com","url":"http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"},"item":{"title":"Conditions for San Francisco, CA at 11:52 pm PDT","lat":"37.78","long":"-122.46","link":"http://us.rd.yahoo.com/dailynews/rss/weather/San_Francisco__CA/*http://weather.yahoo.com/forecast/USCA0987_f.html","pubDate":"Fri, 13 Sep 2013 11:52 pm PDT","condition":{"code":"26","date":"Fri, 13 Sep 2013 11:52 pm PDT","temp":"59","text":"Cloudy"},"description":"\n<img src=\"http://l.yimg.com/a/i/us/we/52/26.gif\"/><br />\n<b>Current Conditions:</b><br />\nCloudy, 59 F<BR />\n<BR /><b>Forecast:</b><BR />\nFri - Cloudy. High: 65 Low: 56<br />\nSat - Partly Cloudy. High: 66 Low: 57<br />\nSun - Partly Cloudy. High: 68 Low: 59<br />\nMon - Partly Cloudy. High: 68 Low: 58<br />\nTue - Sunny. High: 70 Low: 57<br />\n<br />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/San_Francisco__CA/*http://weather.yahoo.com/forecast/USCA0987_f.html\">Full Forecast at Yahoo! Weather</a><BR/><BR/>\n(provided by <a href=\"http://www.weather.com\" >The Weather Channel</a>)<br/>\n","forecast":[{"code":"26","date":"13 Sep 2013","day":"Fri","high":"65","low":"56","text":"Cloudy"},{"code":"30","date":"14 Sep 2013","day":"Sat","high":"66","low":"57","text":"Partly Cloudy"},{"code":"30","date":"15 Sep 2013","day":"Sun","high":"68","low":"59","text":"Partly Cloudy"},{"code":"30","date":"16 Sep 2013","day":"Mon","high":"68","low":"58","text":"Partly Cloudy"},{"code":"32","date":"17 Sep 2013","day":"Tue","high":"70","low":"57","text":"Sunny"}],"guid":{"isPermaLink":"false","content":"USCA0987_2013_09_17_7_00_PDT"}}}}}}:ET:@created_atf1379144654.744537:@expires_inf6e1
|
@@ -0,0 +1 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry:@valueI"
|
@@ -0,0 +1 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry:@valueI"2459115:ET:@created_atf1379144405.120568:@expires_in0
|
data/test/yahoo_weather_test.rb
CHANGED
@@ -15,20 +15,6 @@ class YahooWeatherTest < ActiveSupport::TestCase
|
|
15
15
|
'San Francisco', 'CA', 'United States')
|
16
16
|
end
|
17
17
|
|
18
|
-
test 'Fetch with the bad response' do
|
19
|
-
client = YahooWeather::Client.new
|
20
|
-
woeid_sf = '10001'
|
21
|
-
FakeWeb.register_uri(
|
22
|
-
:get,
|
23
|
-
"http://weather.yahooapis.com/forecastrss?w=#{woeid_sf}&u=f",
|
24
|
-
:body => "Nothing to be found 'round here",
|
25
|
-
:status => ["404", "Not Found"]
|
26
|
-
)
|
27
|
-
problem = assert_raise(RuntimeError) {client.fetch(woeid_sf)}
|
28
|
-
assert_equal "Failed to get xml. Got a bad status code 404 Not Found", problem.message
|
29
|
-
FakeWeb.clean_registry
|
30
|
-
end
|
31
|
-
|
32
18
|
test 'Success response' do
|
33
19
|
assert_instance_of YahooWeather::Condition, @response.condition
|
34
20
|
assert_instance_of YahooWeather::Location, @response.location
|
data/yahoo_weather.gemspec
CHANGED
@@ -16,7 +16,6 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.require_paths = ['lib']
|
17
17
|
s.test_files = Dir['test/**/*']
|
18
18
|
s.add_dependency 'rails', '>= 3.1.0'
|
19
|
-
s.add_dependency 'nokogiri'
|
20
19
|
s.add_development_dependency 'sqlite3'
|
21
20
|
s.add_development_dependency 'fakeweb', '~> 1.3'
|
22
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahoo_weather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ildar Manzhikov
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.1.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: nokogiri
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '>='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: sqlite3
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,11 +124,18 @@ files:
|
|
138
124
|
- test/yahoo_weather_test.rb
|
139
125
|
- yahoo_weather.gemspec
|
140
126
|
- test/dummy/log/test.log
|
127
|
+
- test/dummy/tmp/cache/4BA/650/woeid+for+94025
|
141
128
|
- test/dummy/tmp/cache/62E/480/woeid+for+Moscow
|
129
|
+
- test/dummy/tmp/cache/786/890/yahoo_weather_10001_f
|
130
|
+
- test/dummy/tmp/cache/7FF/F00/yahoo_weather_2459115_f
|
142
131
|
- test/dummy/tmp/cache/82F/B30/yahoo_weather_12794004_f
|
132
|
+
- test/dummy/tmp/cache/831/AD0/yahoo_weather_12761336_f
|
133
|
+
- test/dummy/tmp/cache/838/DA0/yahoo_weather_12797118_f
|
143
134
|
- test/dummy/tmp/cache/839/E20/yahoo_weather_12788173_f
|
144
135
|
- test/dummy/tmp/cache/839/F10/yahoo_weather_29391445_f
|
145
136
|
- test/dummy/tmp/cache/83D/EE0/yahoo_weather_12797168_f
|
137
|
+
- test/dummy/tmp/cache/A79/3C0/yahoo_weather_woeid+for+10004
|
138
|
+
- test/dummy/tmp/cache/C7E/C30/yahoo_weather_woeid+for+New+York
|
146
139
|
homepage: http://github.com/manzhikov/yahoo_weather
|
147
140
|
licenses:
|
148
141
|
- MIT
|
@@ -202,10 +195,17 @@ test_files:
|
|
202
195
|
- test/dummy/public/favicon.ico
|
203
196
|
- test/dummy/Rakefile
|
204
197
|
- test/dummy/README.rdoc
|
198
|
+
- test/dummy/tmp/cache/4BA/650/woeid+for+94025
|
205
199
|
- test/dummy/tmp/cache/62E/480/woeid+for+Moscow
|
200
|
+
- test/dummy/tmp/cache/786/890/yahoo_weather_10001_f
|
201
|
+
- test/dummy/tmp/cache/7FF/F00/yahoo_weather_2459115_f
|
206
202
|
- test/dummy/tmp/cache/82F/B30/yahoo_weather_12794004_f
|
203
|
+
- test/dummy/tmp/cache/831/AD0/yahoo_weather_12761336_f
|
204
|
+
- test/dummy/tmp/cache/838/DA0/yahoo_weather_12797118_f
|
207
205
|
- test/dummy/tmp/cache/839/E20/yahoo_weather_12788173_f
|
208
206
|
- test/dummy/tmp/cache/839/F10/yahoo_weather_29391445_f
|
209
207
|
- test/dummy/tmp/cache/83D/EE0/yahoo_weather_12797168_f
|
208
|
+
- test/dummy/tmp/cache/A79/3C0/yahoo_weather_woeid+for+10004
|
209
|
+
- test/dummy/tmp/cache/C7E/C30/yahoo_weather_woeid+for+New+York
|
210
210
|
- test/test_helper.rb
|
211
211
|
- test/yahoo_weather_test.rb
|