Permalink
Browse files

add coordinates method

  • Loading branch information...
1 parent 82abf2a commit 0b4a36557a2922afc9e6835f3c7a7309d732107d @afnecors afnecors committed Jun 26, 2013
Showing with 6 additions and 2 deletions.
  1. +1 −1 lib/wikipedia/client.rb
  2. +5 −1 lib/wikipedia/page.rb
View
@@ -27,7 +27,7 @@ def find_image( title, options = {} )
def request_page( title, options = {} )
request( {
:action => "query",
- :prop => %w{ revisions links images categories },
+ :prop => %w{ revisions links images categories coordinates },
:rvprop => "content",
:titles => title
}.merge( options ) )
View
@@ -59,7 +59,11 @@ def image_urls
def image_descriptionurl
page['imageinfo'].first['descriptionurl'] if page['imageinfo']
- end
+ end
+
+ def coordinates
+ page['coordinates'].first.values if page['coordinates']
+ end
def raw_data
@data

0 comments on commit 0b4a365

Please sign in to comment.