Permalink
Browse files

add templates method

  • Loading branch information...
1 parent a7923db commit 59cb2db06f936f08c86313aa3e6e5b922ea9dccd @afnecors afnecors committed Jun 27, 2013
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/wikipedia/client.rb
  2. +4 −0 lib/wikipedia/page.rb
@@ -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 ) )
@@ -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 59cb2db

Please sign in to comment.