Permalink
Browse files

Merge pull request #8 from afnecors/templates

add templates method
  • Loading branch information...
kenpratt committed Jun 27, 2013
2 parents a7923db + 59cb2db commit bba39cba6302da12a621ef9fbe881832b08637bb
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/wikipedia/client.rb
  2. +4 −0 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 coordinates },
+ :prop => %w{ revisions links images categories coordinates templates },
:rvprop => "content",
:titles => title
}.merge( options ) )
View
@@ -69,6 +69,10 @@ def raw_data
@data
end
+ def templates
+ page['templates'].map {|c| c['title'] } if page['templates']
+ end
+
def json
@json
end

0 comments on commit bba39cb

Please sign in to comment.