public
Rubygem
Description: An object-oriented Ruby wrapper for the YouTube GData API
Homepage: http://groups.google.com/group/ruby-youtube-library
Clone URL: git://github.com/tmm1/youtube-g.git
Add Geodata information (thanks Jose Galisteo)
tmm1 (author)
Tue Sep 02 02:47:06 -0700 2008
commit  d424400ac1142344543bdbc1fe9860dd0dc4f0cd
tree    3392e48360206f23a9e8766d2fa18092110382f9
parent  7257f254d731443b85c0ccb119febdba978352de
...
1
 
 
 
2
3
4
...
 
1
2
3
4
5
6
0
@@ -1,4 +1,6 @@
0
-== trunk
0
+== 0.4.9.9 / 2008-09-01
0
+
0
+* Add Geodata information (thanks Jose Galisteo)
0
 * Added :page and :per_page options, this allows easier usage of the will_paginate
0
   plugin with the library. The :offset and :max_results options are no longer available. [Daniel Insley]
0
 * Added ability to get video responses on the instances of the YouTube::Model::Video object. [Daniel Insley]
...
108
109
110
 
 
 
 
 
 
111
112
113
...
108
109
110
111
112
113
114
115
116
117
118
119
0
@@ -108,6 +108,12 @@ class YouTubeG
0
       
0
       # *Fixnum*:: Number of times that the video has been viewed
0
       attr_reader :view_count
0
+
0
+      # Geodata
0
+      attr_reader :where
0
+      attr_reader :position
0
+      attr_reader :latitude
0
+      attr_reader :longitude
0
       
0
       attr_reader :statistics
0
       
...
91
92
93
 
 
 
 
 
94
95
96
...
108
109
110
111
 
 
 
 
 
112
113
114
...
91
92
93
94
95
96
97
98
99
100
101
...
113
114
115
 
116
117
118
119
120
121
122
123
0
@@ -91,6 +91,11 @@ class YouTubeG
0
         noembed = entry.elements["yt:noembed"] ? true : false
0
         racy = entry.elements["media:rating"] ? true : false
0
 
0
+        if where = entry.elements["georss:where"]
0
+          position = where.elements["gml:Point"].elements["gml:pos"].text
0
+          latitude, longitude = position.split(" ")
0
+        end
0
+
0
         YouTubeG::Model::Video.new(
0
           :video_id => video_id,
0
           :published_at => published_at,
0
@@ -108,7 +113,11 @@ class YouTubeG
0
           :rating => rating,
0
           :view_count => view_count,
0
           :noembed => noembed,
0
-          :racy => racy)
0
+          :racy => racy,
0
+          :where => where,
0
+          :position => position,
0
+          :latitude => latitude,
0
+          :longitude => longitude)
0
       end
0
 
0
       def parse_media_content (media_content_element) 

Comments