Permalink
Browse files

Reformatted readme to textile.

  • Loading branch information...
1 parent b7dcd61 commit ac46b99c7e42b84839364def3634f9b1e1549f28 @kenpratt committed Mar 10, 2010
Showing with 17 additions and 17 deletions.
  1. +17 −17 README → README.textile
View
@@ -1,12 +1,15 @@
-== Wikipedia
+h1. Wikipedia
Allows you to get wikipedia content through their API. This uses the
alpha API, not the deprecated query.php API type
+Wikipedia API reference: http://en.wikipedia.org/w/api.php
-== Examples
+Adopted from: http://code.google.com/p/wikipedia-client/
-require 'wikipedia'
+h2. Examples
+
+<pre><code>require 'wikipedia'
page = Wikipedia.find( 'Getting Things Done' )
=> #<Wikipedia:Page>
@@ -33,20 +36,18 @@ page.images
page.image_urls
-=> ["http://upload.wikimedia.org/wikipedia/en/e/e1/Getting_Things_Done.jpg", ...]]
-
+=> ["http://upload.wikimedia.org/wikipedia/en/e/e1/Getting_Things_Done.jpg", ...]]</code></pre>
-== Configuration
+h2. Configuration
-This is by default configured like this
+This is by default configured like this:
-Wikipedia::Configure {
+<pre><code>Wikipedia.Configure {
domain 'en.wikipedia.org'
path 'w/api.php'
-}
+}</code></pre>
-
-== Advanced
+h2. Advanced
See the API spec at http://en.wikipedia.org/w/api.php
@@ -55,7 +56,7 @@ parameters.
For example, to retrieve only the page info:
-page = Wikipedia.find( 'Getting Things Done', :prop => "info" )
+<pre><code>page = Wikipedia.find( 'Getting Things Done', :prop => "info" )
page.title
@@ -65,17 +66,16 @@ page.raw_data
=> {"query"=>{"pages"=>{"959928"=>{"pageid"=>959928, "ns"=>0,
"title"=>"Getting Things Done", "touched"=>"2010-03-10T00:04:09Z",
-"lastrevid"=>348481810, "counter"=>0, "length"=>7891}}}}
-
+"lastrevid"=>348481810, "counter"=>0, "length"=>7891}}}}</code></pre>
-== Running specs
+h2. Running specs
if you have rspec >= 1.1.3 installed just type in
rake spec
-Thanks!
+h2. Thanks!
Copyright (c) 2008 [Cyril David], released under the MIT license
-Adopted by Ken Pratt (ken@kenpratt.net)
+Adopted by Ken Pratt (ken@kenpratt.net) in 2010/03

0 comments on commit ac46b99

Please sign in to comment.