wikipedia-client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/.gitignore +5 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.textile +81 -0
  4. data/Rakefile +60 -0
  5. data/VERSION +1 -0
  6. data/init.rb +1 -0
  7. data/install.rb +1 -0
  8. data/lib/wikipedia.rb +37 -0
  9. data/lib/wikipedia/client.rb +91 -0
  10. data/lib/wikipedia/configuration.rb +25 -0
  11. data/lib/wikipedia/page.rb +109 -0
  12. data/lib/wikipedia/url.rb +14 -0
  13. data/script/add_sanitization_test +22 -0
  14. data/spec/fixtures/Edsger_Dijkstra.json +1 -0
  15. data/spec/fixtures/Edsger_Dijkstra.yaml +184 -0
  16. data/spec/fixtures/Edsger_Dijkstra_section_0.json +1 -0
  17. data/spec/fixtures/Edsger_content.txt +1 -0
  18. data/spec/fixtures/File_Edsger_Wybe_Dijkstra_jpg.json +1 -0
  19. data/spec/fixtures/sanitization_samples/Ceawlin_of_Wessex-raw.txt +19 -0
  20. data/spec/fixtures/sanitization_samples/Ceawlin_of_Wessex-sanitized.txt +3 -0
  21. data/spec/fixtures/sanitization_samples/Edsger_W_Dijkstra-raw.txt +26 -0
  22. data/spec/fixtures/sanitization_samples/Edsger_W_Dijkstra-sanitized.txt +2 -0
  23. data/spec/fixtures/sanitization_samples/Flower_video_game-raw.txt +25 -0
  24. data/spec/fixtures/sanitization_samples/Flower_video_game-sanitized.txt +2 -0
  25. data/spec/fixtures/sanitization_samples/How_to_Lose_Friends__Alienate_People_film-raw.txt +28 -0
  26. data/spec/fixtures/sanitization_samples/How_to_Lose_Friends__Alienate_People_film-sanitized.txt +2 -0
  27. data/spec/fixtures/sanitization_samples/Kirsten_Dunst-raw.txt +16 -0
  28. data/spec/fixtures/sanitization_samples/Kirsten_Dunst-sanitized.txt +3 -0
  29. data/spec/fixtures/sanitization_samples/Large_Hadron_Collider-raw.txt +104 -0
  30. data/spec/fixtures/sanitization_samples/Large_Hadron_Collider-sanitized.txt +4 -0
  31. data/spec/fixtures/sanitization_samples/Metro_Goldwyn_Mayer-raw.txt +18 -0
  32. data/spec/fixtures/sanitization_samples/Metro_Goldwyn_Mayer-sanitized.txt +1 -0
  33. data/spec/fixtures/sanitization_samples/Middle_Ages-raw.txt +10 -0
  34. data/spec/fixtures/sanitization_samples/Middle_Ages-sanitized.txt +3 -0
  35. data/spec/fixtures/sanitization_samples/SMS_Elbing-raw.txt +51 -0
  36. data/spec/fixtures/sanitization_samples/SMS_Elbing-sanitized.txt +1 -0
  37. data/spec/fixtures/sanitization_samples/Sashimi-raw.txt +16 -0
  38. data/spec/fixtures/sanitization_samples/Sashimi-sanitized.txt +7 -0
  39. data/spec/fixtures/sanitization_samples/Superb_Fairywren-raw.txt +35 -0
  40. data/spec/fixtures/sanitization_samples/Superb_Fairywren-sanitized.txt +3 -0
  41. data/spec/fixtures/sanitization_samples/Velociraptor-raw.txt +28 -0
  42. data/spec/fixtures/sanitization_samples/Velociraptor-sanitized.txt +3 -0
  43. data/spec/lib/client_spec.rb +108 -0
  44. data/spec/lib/sanitize_spec.rb +14 -0
  45. data/spec/lib/url_spec.rb +8 -0
  46. data/spec/lib/wikipedia_spec.rb +20 -0
  47. data/spec/spec_helper.rb +4 -0
  48. data/tasks/wikipedia_tasks.rake +4 -0
  49. data/uninstall.rb +1 -0
  50. data/wikipedia-client.gemspec +96 -0
  51. metadata +134 -0
@@ -0,0 +1,4 @@
1
+ <p>The <b>Large Hadron Collider</b> (<b>LHC</b>) is the world's largest and highest-energy particle accelerator, intended to collide opposing particle beams of either protons at an energy of 7&nbsp;TeV (1.12&nbsp;microjoules) per particle, or lead nuclei at an energy of 574&nbsp;TeV (92.0&nbsp;microjoules) per nucleus. The term <i>hadron</i> refers to particles composed of quarks. It is expected that it will address the most fundamental questions of physics, hopefully allowing progress in understanding the deepest laws of nature. The LHC lies in a tunnel in circumference, as much as beneath the Franco-Swiss border near Geneva, Switzerland.</p>
2
+ <p>The Large Hadron Collider was built by the European Organization for Nuclear Research (CERN) with the intention of testing various predictions of high-energy physics, including the existence of the hypothesized Higgs boson and of the large family of new particles predicted by supersymmetry. It is funded by and built in collaboration with over 10,000 scientists and engineers from over 100 countries as well as hundreds of universities and laboratories.</p>
3
+ <p>On 10 September 2008, the proton beams were successfully circulated in the main ring of the LHC for the first time, but nine days later, operations were halted due to a serious fault between two superconducting bending magnets. Repairing the resulting damage and installing additional safety features took over a year. On 20 November 2009, the proton beams were successfully circulated again, with the first proton–proton collisions being recorded three days later at the injection energy of 450 GeV per beam. The LHC became the world's highest energy particle accelerator on 30 November 2009, achieving a world record 1.18 TeV per beam and beating the record previously held by Fermilab's Tevatron. After the 2009 winter shutdown, the LHC was restarted and the beam was ramped up to 3.5 TeV per beam, half its designed energy, which is planned for after its 2012 shutdown.</p>
4
+ <p>On 30 March 2010, the first planned collisions took place between two 3.5 TeV beams, which set a new world record for the highest energy man-made particle collisions.</p>
@@ -0,0 +1,18 @@
1
+ {{Redirect|MGM}}
2
+ {{Infobox company
3
+ |company_name = Metro-Goldwyn-Mayer<br><small>Metro-Goldwyn-Mayer, Inc.</small><br><small>Metro-Goldwyn-Mayer Studios, Inc.</small><br><small>Metro-Goldwyn-Mayer Pictures, Inc.</small> | |
4
+ |company_logo = [[Image:MGM logo.png|200px]]
5
+ |company_type = [[Privately held company|Private]]
6
+ |owner = [[Sony Corporation of America]] <br />[[Comcast]]<br />[[Providence Equity Partners]] <br />[[TPG Capital, L.P.]] <br />[[DLJ Merchant Banking Partners]] <br />[[Quadrangle Group]]<ref>There is confusion over Comcast's ownership of MGM. At least one source says Comcast sold its interest. See: [http://www.variety.com/article/VR1118007567.html?categoryid=13&cs=1 McNary, Dave. "Can Cooper Turn Around MGM?"] ''Variety.'' August 21, 2009. Other sources, published on or around the same date, say Comcast still owns part of MGM. See: [http://www.nytimes.com/2009/08/19/business/media/19mgm.html Barnes, Brooks. "MGM Replaces Chief Executive."] ''[[The New York Times]].'' August 18, 2009; [http://www.mediaweek.co.uk/News/MostEmailed/927910/Sloan-ousted-MGM-boss/ O'Carroll, Tristan. "Sloan Ousted as MGM Boss."] ''Media Week.'' August 19, 2009; [http://www.latimes.com/business/la-fi-ct-mgm-sloan19-2009aug19,0,7213585.story Eller, Claudia. "Harry Sloan Out as CEO at MGM."] ''[[Los Angeles Times]].'' August 19, 2009; [http://online.wsj.com/article/SB125061438206040461.html Lattman, Peter and Schuker, Lauren A.E. "MGM Recasts Leadership in Bid to Dig Out of Debt."] ''[[Wall Street Journal]].'' August 19, 2009; [http://www.ft.com/cms/s/0/f0de3aba-8c56-11de-b14f-00144feabdc0.html Li, Kenneth. "MGM Installs New Restructuring Team."] ''[[Financial Times]].'' August 19, 2009; [http://www.google.com/hostednews/ap/article/ALeqM5iJzFImRYd-tFdnhrCxL7e0GAyC6AD9A5KL6G0 Nakashima, Ryan. "Metro-Goldwyn-Mayer Studio Ousts Sloan as CEO."] ''Associated Press.'' August 19, 2009.</ref>
7
+ | foundation = April 16, 1924<ref name="Eyman" />
8
+ | location = [[Century City, Los Angeles, California]], [[United States|U.S.]]
9
+ |key_people = Harry Sloan, [[Chairman]]<ref name="Sloan" /><br>Mary Parent, Bedi A. Singh, & Stephen F. Cooper, Office of [[CEO]]<ref name="Sloan" />
10
+ |num_employees = 400 (as of 2006)<ref>[http://www.hoovers.com/MGM/--ID__47981--/free-co-factsheet.xhtml "Metro-Goldwyn-Mayer Inc."] ''[[Hoover's]].'' No date. Accessed 2009-08-22.</ref>
11
+ |industry = [[Motion picture]]s
12
+ |products = [[Motion picture]]s<br />[[Television program]]s
13
+ |revenue =
14
+ |parent = [[MGM Holdings|MGM Holdings, Inc.]]
15
+ |homepage = http://www.mgm.com
16
+ }}
17
+
18
+ '''Metro-Goldwyn-Mayer Inc.''', or '''MGM''', is an [[United States|American]] [[Mass media|media]] company, involved primarily in the production and distribution of [[film]]s and [[television]] programs. MGM was founded in 1924 when the entertainment entrepreneur [[Marcus Loew]] gained control of [[Metro Pictures]], [[Goldwyn Pictures Corporation]] and [[Louis B. Mayer Pictures]].<ref name="Eyman">Eyman, Scott. ''Lion of Hollywood: The Life and Legend of Louis B. Mayer.'' New York: Simon and Schuster, 2005. ISBN 0743204816</ref><ref name="Balio">Balio, Tino. ''The American Film Industry.'' 2d rev. ed. Madison, Wisc.: University of Wisconsin Press, 1985. ISBN 0299098745</ref>
@@ -0,0 +1 @@
1
+ <b>Metro-Goldwyn-Mayer Inc.</b>, or <b>MGM</b>, is an American media company, involved primarily in the production and distribution of films and television programs. MGM was founded in 1924 when the entertainment entrepreneur Marcus Loew gained control of Metro Pictures, Goldwyn Pictures Corporation and Louis B. Mayer Pictures.
@@ -0,0 +1,10 @@
1
+ {{Other}}
2
+ {{redirect2|Medieval|Mediaeval}}
3
+ {{pp-move-indef}}
4
+ [[File:Karl 1 mit papst gelasius gregor1 sacramentar v karl d kahlen.jpg|thumb|300px|Ninth-century depiction of [[Charlemagne]] with popes [[Gelasius I]] and [[Gregory the Great]]]]
5
+ The '''Middle Ages''' (adjectival form: '''medieval''' or '''mediæval''') is a period of [[European history]] covering roughly a [[millennium]] from the [[5th century]] through to the [[16th century]]. It is commonly dated from the [[Decline of the Roman Empire|fall of the Western Roman Empire]], and contrasted with a later [[Early Modern Period]]; the time during which the rise of [[humanism]] in the [[Italian Renaissance]] and the [[Protestant Reformation|Reformation]] unfolded, are generally associated with the transition out of the Middle Ages, with European overseas expansion as a succeeding process, but such dates are approximate and based upon nuanced arguments.
6
+
7
+ More specific starting and ending points are sometimes adopted by scholars to suit their respective specializations or current focus. In particular, in British history, the Middle Ages are often understood to start at the [[Norman conquest of England|Norman conquest]] of 1066 and continue through to about the end of the 15th century (the era between the fall of the Roman Empire and the Norman conquest is referred to as the [[Anglo-Saxon England | Anglo-Saxon]] period). "[[#Periodization issues|Periodization issues]]" are discussed in a later section of this article.
8
+
9
+ The Middle Ages included the first sustained [[urbanization]] of northern and western [[Europe]]. Many modern European countries owe their origins to events and trends in the Middle Ages; present European political boundaries are, in many regards, the result of the military and dynastic outcomes during this period.
10
+ [[File:Neamt Citadel 05.jpg|thumb|right|220px|[[Neamţ Citadel]], [[Romania]]]]
@@ -0,0 +1,3 @@
1
+ <p>The <b>Middle Ages</b> (adjectival form: <b>medieval</b> or <b>mediæval</b>) is a period of European history covering roughly a millennium from the 5th century through to the 16th century. It is commonly dated from the fall of the Western Roman Empire, and contrasted with a later Early Modern Period; the time during which the rise of humanism in the Italian Renaissance and the Reformation unfolded, are generally associated with the transition out of the Middle Ages, with European overseas expansion as a succeeding process, but such dates are approximate and based upon nuanced arguments.</p>
2
+ <p>More specific starting and ending points are sometimes adopted by scholars to suit their respective specializations or current focus. In particular, in British history, the Middle Ages are often understood to start at the Norman conquest of 1066 and continue through to about the end of the 15th century (the era between the fall of the Roman Empire and the Norman conquest is referred to as the Anglo-Saxon period). "Periodization issues" are discussed in a later section of this article.</p>
3
+ <p>The Middle Ages included the first sustained urbanization of northern and western Europe. Many modern European countries owe their origins to events and trends in the Middle Ages; present European political boundaries are, in many regards, the result of the military and dynastic outcomes during this period.</p>
@@ -0,0 +1,51 @@
1
+ {|{{Infobox Ship Begin}}
2
+ {{Infobox Ship Image
3
+ |Ship image=[[Image:SMS Elbing.jpg|300px]]
4
+ |Ship caption=
5
+ }}
6
+ {{Infobox Ship Career
7
+ |Hide header=
8
+ |Ship country=[[German Empire]]
9
+ |Ship flag=[[Image:War Ensign of Germany 1903-1918.svg|KLM ensign|44px]]
10
+ |Ship name=''Elbing''
11
+ |Ship namesake=City of [[Elbląg|Elbing]]
12
+ |Ship ordered=
13
+ |Ship builder=[[Schichau]], [[Danzig]]
14
+ |Ship laid down=September 1913
15
+ |Ship launched=21 November 1914
16
+ |Ship acquired=
17
+ |Ship commissioned=4 September 1915
18
+ |Ship decommissioned=
19
+ |Ship in service=
20
+ |Ship out of service=
21
+ |Ship struck=
22
+ |Ship reinstated=
23
+ |Ship honours=
24
+ |Ship fate=sunk night of 31 May 1916, at the [[Battle of Jutland]]
25
+ |Ship status=
26
+ |Ship notes=
27
+ }}
28
+ {{Infobox Ship Characteristics
29
+ |Hide header=
30
+ |Header caption=
31
+ |Ship class=[[Pillau class light cruiser|''Pillau'' class]] [[light cruiser]]
32
+ |Ship displacement=4,390 tonnes normal<br>5,252 tonnes full load
33
+ |Ship length={{convert|135.3|m|ft|abbr=on}}
34
+ |Ship beam={{convert|13.6|m|ft|abbr=on}}
35
+ |Ship draught={{convert|5.64|m|ft|abbr=on}}
36
+ |Ship draft=
37
+ |Ship propulsion=2 shaft Navy turbines, 30,000 shp
38
+ |Ship speed={{convert|27.5|knot|km/h|1}}
39
+ |Ship range=
40
+ |Ship complement=442
41
+ |Ship sensors=
42
+ |Ship EW=
43
+ |Ship armament=8 x {{convert|15|cm|in|abbr=on}} SKL/ 45cal (8 x 1), 2 x {{convert|8.8|cm|in|abbr=on}} (2 x 1), 2 x {{convert|50|cm|in|abbr=on}} TT, 120 mines
44
+ |Ship armour=
45
+ |Ship armor=Deck {{convert|3|in|mm|abbr=on}} - {{convert|.5|in|mm|abbr=on}}
46
+ |Ship aircraft=
47
+ |Ship notes=
48
+ }}
49
+ |}
50
+
51
+ The '''SMS ''Elbing''''' was a [[Germany|German]] ''Pillau'' class [[light cruiser]], named after the East Prussian city of Elbing. Intended for the Russian navy under the name ''Admiral Newelski'' (named after [[Gennady Nevelskoy|the discoverer of the insularity of Sakhalin]]), the ship was built at F. [[Schichau-Werft]] in [[Danzig]] in 1913-1914. Following the outbreak of [[World War I]], the ship was confiscated and launched on 21 November 1914 as the SMS ''Elbing''.
@@ -0,0 +1 @@
1
+ The <b>SMS <i>Elbing</b></i> was a German <i>Pillau</i> class light cruiser, named after the East Prussian city of Elbing. Intended for the Russian navy under the name <i>Admiral Newelski</i> (named after the discoverer of the insularity of Sakhalin), the ship was built at F. Schichau-Werft in Danzig in 1913-1914. Following the outbreak of World War I, the ship was confiscated and launched on 21 November 1914 as the SMS <i>Elbing</i>.
@@ -0,0 +1,16 @@
1
+ {{for|the open software project|Mass spectrometry data format}}
2
+ [[Image:Sashimi.jpg|thumb|right|A sashimi dinner set]]
3
+ [[Image:Fugu_sashimi.jpg|thumb|right|''Tessa'' ([[Puffer Fish]])]]
4
+ [[Image:Salmon sashimi.jpg|thumb|right|A sashimi salmon rose]]
5
+ [[Image:Chef preparing octopus sashimi, December 2005.jpg|thumb|In restaurants, sashimi often is prepared at a bar, in view of the patrons.]]
6
+ [[Image:Salmon Sashimi with Calamansi.JPG|thumb|250pcx|Salmon sashimi served with [[Calamondin|calamansi]]. The juice can be mixed with the shoyu or applied directly to the sashimi.]]
7
+ [[Image:Sashimis.jpg|thumb|250[cx|Assorted sashimi]]
8
+ '''Sashimi''' ({{lang-ja|刺身}}, {{IPA-ja|saɕimiꜜ|pron}}; {{IPA-en|səˈʃiːmiː|lang}}) is a [[Japanese cuisine|Japanese delicacy]] primarily consisting of very fresh raw [[seafood]], sliced into thin pieces and served with only a dipping sauce ([[soy sauce]] with [[wasabi]] paste or other condiments such as grated fresh [[ginger]], or [[ponzu]]), depending on the fish, and simple garnishes such as [[perilla|shiso]] and shredded [[daikon]] radish. Dimensions vary depending on the type of item and chef, but are typically about 2.5 cm (1") wide by 4 cm (1.5") long by 0.5 cm (0.2") thick.
9
+
10
+ The word ''sashimi'' means "pierced body", i.e. "[[wikt:刺身|刺身]] = ''sashimi'' = [[wikt:刺|刺]][[wikt:し|し]] = ''sashi'' (pierced, stuck) and [[wikt:身|身]] = ''mi'' (body, meat).
11
+ This word had used from [[Muromachi period]], withheld the word "[[wikt:切る|切る]] = ''Cut'' ,the culinary step, by [[Samurai]] for inauspiciousness.
12
+ This word may derive from the culinary practice of sticking the fish's tail and fin to the slices in identifying the fish being eaten.
13
+
14
+ Another possibility for the name could come from the traditional method of harvesting. 'Sashimi Grade' fish is caught by individual handline, and as soon as the fish is landed, its brain is pierced with a sharp spike, killing it instantly, then placed in slurried ice. This spiking is called the [[Ike jime]] process. Because the flesh thus contains minimal lactic acid from the fish dying slowly, it will keep fresh on ice for about 10 days without turning white, or otherwise degrading. {{Fact|date=October 2007}}
15
+
16
+ The word ''sashimi'' has been integrated into the [[English language]] and is often used to refer to other uncooked fish preparations besides the traditional Japanese dish subject of this article. Many non-Japanese conflate sashimi and [[sushi]]; the two dishes are actually distinct and separate. Sushi refers to any dish made with vinegared rice, and while raw fish is one traditional sushi ingredient, many sushi dishes contain seafood that has been cooked, while others have no seafood at all.
@@ -0,0 +1,7 @@
1
+ <p>[[Image:Sashimis.jpg|thumb|250[cx|Assorted sashimi]]
2
+ <b>Sashimi</b> (, ; ) is a Japanese delicacy primarily consisting of very fresh raw seafood, sliced into thin pieces and served with only a dipping sauce (soy sauce with wasabi paste or other condiments such as grated fresh ginger, or ponzu), depending on the fish, and simple garnishes such as shiso and shredded daikon radish. Dimensions vary depending on the type of item and chef, but are typically about 2.5 cm (1") wide by 4 cm (1.5") long by 0.5 cm (0.2") thick.</p>
3
+ <p>The word <i>sashimi</i> means "pierced body", i.e. "刺身 = <i>sashimi</i> = 刺し = <i>sashi</i> (pierced, stuck) and 身 = <i>mi</i> (body, meat).
4
+ This word had used from Muromachi period, withheld the word "切る = <i>Cut</i> ,the culinary step, by Samurai for inauspiciousness.
5
+ This word may derive from the culinary practice of sticking the fish's tail and fin to the slices in identifying the fish being eaten.</p>
6
+ <p>Another possibility for the name could come from the traditional method of harvesting. 'Sashimi Grade' fish is caught by individual handline, and as soon as the fish is landed, its brain is pierced with a sharp spike, killing it instantly, then placed in slurried ice. This spiking is called the Ike jime process. Because the flesh thus contains minimal lactic acid from the fish dying slowly, it will keep fresh on ice for about 10 days without turning white, or otherwise degrading.</p>
7
+ <p>The word <i>sashimi</i> has been integrated into the English language and is often used to refer to other uncooked fish preparations besides the traditional Japanese dish subject of this article. Many non-Japanese conflate sashimi and sushi; the two dishes are actually distinct and separate. Sushi refers to any dish made with vinegared rice, and while raw fish is one traditional sushi ingredient, many sushi dishes contain seafood that has been cooked, while others have no seafood at all.</p>
@@ -0,0 +1,35 @@
1
+ {{Taxobox
2
+ | name = Superb Fairywren
3
+ | status = LC
4
+ | status_system = iucn3.1
5
+ | status_ref =<ref>{{IUCN2006|assessors=[[BirdLife International]]|year=2004|id=50687|title=Malurus cyaneus|downloaded=9 May 2006}}</ref>
6
+ | image = Male superb fairy wren.jpg
7
+ | image_width = 200px
8
+ | image_caption = Male in breeding plumage<br>subspecies ''cyaneus''
9
+ |image_alt=a small long-tailed vivid pale blue and black bird perched among some grasslike vegetation
10
+ | image2 = Female superb fairy wren-edit1.jpg
11
+ | image2_width = 200px
12
+ | image2_caption = Female – Victorian High Country
13
+ |image2_alt=a small pale brown bird with a gaping orange beak, on twiglike foliage
14
+ | regnum = [[Animal]]ia
15
+ | phylum = [[Chordate|Chordata]]
16
+ | classis = [[Bird|Aves]]
17
+ | ordo = [[Passeriformes]]
18
+ | familia = [[Maluridae]]
19
+ | genus = ''[[Malurus]]''
20
+ | species = '''''M. cyaneus'''''
21
+ | binomial = ''Malurus cyaneus''
22
+ | binomial_authority = Ellis, 1782
23
+ | range_map=Dist blue wren.png
24
+ | range_map_width=200px
25
+ | range_map_caption= Superb Fairywren range<div>{{Legend2|#2BA7D7|''M. c. cyanochlamys''|border=1px solid #aaa}}; {{Legend2|#130882|''M. c. cyaneus''|border=1px solid #aaa}}</div>
26
+ | subdivision_ranks=[[Subspecies]]
27
+ | subdivision=
28
+ * ''M. c. cyaneus''
29
+ * ''M. c. cyanochlamys'' <small>Sharpe, 1881</small>
30
+ }}
31
+ The '''Superb Fairywren''' (''Malurus cyaneus''), also known as '''Superb Blue-wren''' or colloquially as '''Blue wren''', is a [[passerine]] [[bird]] of the [[Maluridae]] family, common and familiar across south-eastern Australia. The species is sedentary and [[Territory (animal)|territorial]], also exhibiting a high degree of [[sexual dimorphism]]; the male in breeding plumage has a striking bright blue forehead, ear [[covert (feather)|coverts]], mantle, and tail, with a black mask and black or dark blue throat. Non-breeding males, females and juveniles are predominantly grey-brown in colour; this gave the early impression that males were polygamous as all dull-coloured birds were taken for females. Two subspecies are recognised: the larger and darker [[Tasmania]]n form ''cyaneus'' and the smaller and paler mainland form ''cyanochlamys''.
32
+
33
+ Like other fairywrens, the Superb Fairywren is notable for several peculiar behavioural characteristics; the birds are socially [[monogamous]] and sexually [[promiscuous]], meaning that although they form pairs between one male and one female, each partner will mate with other individuals and even assist in raising the young from such pairings. Male wrens pluck yellow petals and display them to females as part of a courtship display.
34
+
35
+ The Superb Fairywren can be found in almost any area that has at least a little dense undergrowth for shelter, including grasslands with scattered shrubs, moderately thick forest, woodland, heaths, and domestic [[garden]]s. It has adapted well to the urban environment and is common in suburban Sydney, [[Canberra]] and [[Melbourne]]. The Superb Fairywren mainly eats insects and supplements its diet with seeds.
@@ -0,0 +1,3 @@
1
+ <p>The <b>Superb Fairywren</b> (<i>Malurus cyaneus</i>), also known as <b>Superb Blue-wren</b> or colloquially as <b>Blue wren</b>, is a passerine bird of the Maluridae family, common and familiar across south-eastern Australia. The species is sedentary and territorial, also exhibiting a high degree of sexual dimorphism; the male in breeding plumage has a striking bright blue forehead, ear coverts, mantle, and tail, with a black mask and black or dark blue throat. Non-breeding males, females and juveniles are predominantly grey-brown in colour; this gave the early impression that males were polygamous as all dull-coloured birds were taken for females. Two subspecies are recognised: the larger and darker Tasmanian form <i>cyaneus</i> and the smaller and paler mainland form <i>cyanochlamys</i>.</p>
2
+ <p>Like other fairywrens, the Superb Fairywren is notable for several peculiar behavioural characteristics; the birds are socially monogamous and sexually promiscuous, meaning that although they form pairs between one male and one female, each partner will mate with other individuals and even assist in raising the young from such pairings. Male wrens pluck yellow petals and display them to females as part of a courtship display.</p>
3
+ <p>The Superb Fairywren can be found in almost any area that has at least a little dense undergrowth for shelter, including grasslands with scattered shrubs, moderately thick forest, woodland, heaths, and domestic gardens. It has adapted well to the urban environment and is common in suburban Sydney, Canberra and Melbourne. The Superb Fairywren mainly eats insects and supplements its diet with seeds.</p>
@@ -0,0 +1,28 @@
1
+ {{about|the dinosaur|other uses|Raptor}}
2
+ {{italictitle}}{{Taxobox
3
+ | name = ''Velociraptor''
4
+ | fossil_range = [[Late Cretaceous]], {{fossil range|75|71}}
5
+ | image = Velociraptor Fighting Dinosaur.jpg
6
+ | image_width = 250px
7
+ | image_caption = Skull of the ''Velociraptor mongoliensis'' "Fighting Dinosaurs" specimen
8
+ | regnum = [[Animal]]ia
9
+ | phylum = [[Chordate|Chordata]]
10
+ | classis = [[Reptile|Reptilia]]
11
+ | superordo = [[Dinosaur]]ia
12
+ | ordo = [[Saurischia]]
13
+ | subordo = [[Theropoda]]
14
+ | infraordo = [[Deinonychosauria]]
15
+ | familia = [[Dromaeosauridae]]
16
+ | genus = '''''Velociraptor'''''
17
+ | genus_authority = [[Henry Fairfield Osborn|Osborn]], 1924
18
+ | subdivision_ranks = [[Species]]
19
+ | subdivision =
20
+ *''V. mongoliensis'' <small>Osborn, 1924 ([[Type (biology)|type]])</small>
21
+ *''V. osmolskae'' <small> Godefroit ''et al.'', 2008</small>
22
+ }}
23
+
24
+ '''''Velociraptor''''' ({{pron-en|vɨˈlɒsɨræptər}}; meaning 'swift seizer'<ref name=osborn1924a/>) is a [[genus]] of [[dromaeosaurid]] [[Theropoda|theropod]] [[dinosaur]] that existed approximately 75 to 71&nbsp;[[million years ago]] during the later part of the [[Cretaceous]] [[Period (geology)|Period]].<ref name=PGetal2008/> Only two species are currently recognized, although others have been assigned in the past. The [[type species]] is ''V. mongoliensis''; [[fossil]]s of this species have been discovered in both [[Inner Mongolia|Inner]] and [[Mongolia|Outer Mongolia]] in [[central Asia]]. A second species, ''V. osmolskae'', was named in 2008 for skull material from Inner Mongolia.
25
+
26
+ Smaller than other dromaeosaurids like ''[[Deinonychus]]'' and ''[[Achillobator]]'', the [[turkey (bird)|turkey]]-sized ''Velociraptor'' nevertheless shared many of the same [[anatomy|anatomical]] features. It was a [[biped]]al, [[feather]]ed [[carnivore]] with a long, stiffened tail and an enlarged sickle-shaped [[claw]] on each hindfoot, which is thought to have been used to kill its [[predation|prey]]. ''Velociraptor'' can be distinguished from other dromaeosaurids by its long and low [[skull]], with an upturned snout.
27
+
28
+ ''Velociraptor'' (commonly shortened to 'raptor') is one of the dinosaur genera most familiar to the general public due to its prominent role in the ''[[Jurassic Park (film)|Jurassic Park]]'' motion picture series. In the films it was shown with anatomical inaccuracies, including being much larger than it was in reality and without feathers. It is also well known to [[paleontology|paleontologist]]s, with over a dozen recovered fossil skeletons—the most of any dromaeosaurid. One particularly famous specimen preserves a ''Velociraptor'' locked in combat with a ''[[Protoceratops]]''.
@@ -0,0 +1,3 @@
1
+ <p><b><i>Velociraptor</i></b> (; meaning 'swift seizer'<ref name=osborn1924a/>) is a genus of dromaeosaurid theropod dinosaur that existed approximately 75 to 71&nbsp;million years ago during the later part of the Cretaceous Period.<ref name=PGetal2008/> Only two species are currently recognized, although others have been assigned in the past. The type species is <i>V. mongoliensis</i>; fossils of this species have been discovered in both Inner and Outer Mongolia in central Asia. A second species, <i>V. osmolskae</i>, was named in 2008 for skull material from Inner Mongolia.</p>
2
+ <p>Smaller than other dromaeosaurids like <i>Deinonychus</i> and <i>Achillobator</i>, the turkey-sized <i>Velociraptor</i> nevertheless shared many of the same anatomical features. It was a bipedal, feathered carnivore with a long, stiffened tail and an enlarged sickle-shaped claw on each hindfoot, which is thought to have been used to kill its prey. <i>Velociraptor</i> can be distinguished from other dromaeosaurids by its long and low skull, with an upturned snout.</p>
3
+ <p><i>Velociraptor</i> (commonly shortened to 'raptor') is one of the dinosaur genera most familiar to the general public due to its prominent role in the <i>Jurassic Park</i> motion picture series. In the films it was shown with anatomical inaccuracies, including being much larger than it was in reality and without feathers. It is also well known to paleontologists, with over a dozen recovered fossil skeletons—the most of any dromaeosaurid. One particularly famous specimen preserves a <i>Velociraptor</i> locked in combat with a <i>Protoceratops</i>.</p>
@@ -0,0 +1,108 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require 'json'
3
+
4
+ describe Wikipedia::Client, ".find page (mocked)" do
5
+ before(:each) do
6
+ @client = Wikipedia::Client.new
7
+ @edsger_dijkstra = File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_Dijkstra.json')
8
+ @edsger_content = JSON::load(File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_content.txt'))['content']
9
+ @client.should_receive(:request).and_return(@edsger_dijkstra)
10
+ end
11
+
12
+ it "should execute a request for the page" do
13
+ @client.find('Edsger_Dijkstra')
14
+ end
15
+
16
+ it "should return a page object" do
17
+ @client.find('Edsger_Dijkstra').should be_an_instance_of(Wikipedia::Page)
18
+ end
19
+
20
+ it "should return a page with the correct content" do
21
+ @page = @client.find('Edsger_Dijkstra')
22
+ @page.content.should == @edsger_content
23
+ end
24
+
25
+ it "should return a page with a title of Edsger W. Dijkstra" do
26
+ @page = @client.find('Edsger_Dijkstra')
27
+ @page.title.should == 'Edsger W. Dijkstra'
28
+ end
29
+
30
+ it "should return a page with categories" do
31
+ @page = @client.find('Edsger_Dijkstra')
32
+ @page.categories.should == ["Category:1930 births", "Category:2002 deaths", "Category:All pages needing cleanup", "Category:Articles needing cleanup from April 2009", "Category:Articles with close paraphrasing from April 2009", "Category:Computer pioneers", "Category:Dutch computer scientists", "Category:Dutch physicists", "Category:Eindhoven University of Technology faculty", "Category:Fellows of the Association for Computing Machinery"]
33
+ end
34
+
35
+ it "should return a page with links" do
36
+ @page = @client.find('Edsger_Dijkstra')
37
+ @page.links.should == ["ACM Turing Award", "ALGOL", "ALGOL 60", "Adi Shamir", "Adriaan van Wijngaarden", "Agile software development", "Alan Kay", "Alan Perlis", "Algorithm", "Allen Newell"]
38
+ end
39
+
40
+ it "should return a page with images" do
41
+ @page = @client.find('Edsger_Dijkstra')
42
+ @page.images.should == ["File:Copyright-problem.svg", "File:Dijkstra.ogg", "File:Edsger Wybe Dijkstra.jpg", "File:Speaker Icon.svg", "File:Wikiquote-logo-en.svg"]
43
+ end
44
+ end
45
+
46
+ describe Wikipedia::Client, ".find page with one section (mocked)" do
47
+ before(:each) do
48
+ @client = Wikipedia::Client.new
49
+ @edsger_dijkstra = File.read(File.dirname(__FILE__) + '/../fixtures/Edsger_Dijkstra_section_0.json')
50
+ @edsger_content = File.read(File.dirname(__FILE__) + '/../fixtures/sanitization_samples/Edsger_W_Dijkstra-sanitized.txt').strip
51
+ @client.should_receive(:request).and_return(@edsger_dijkstra)
52
+ end
53
+
54
+ it "should have the correct sanitized intro" do
55
+ @page = @client.find('Edsger_Dijkstra', :rvsection => 0)
56
+ @page.sanitized_content.should == @edsger_content
57
+ end
58
+ end
59
+
60
+ describe Wikipedia::Client, ".find image (mocked)" do
61
+ before(:each) do
62
+ @client = Wikipedia::Client.new
63
+ @edsger_dijkstra = File.read(File.dirname(__FILE__) + '/../fixtures/File_Edsger_Wybe_Dijkstra_jpg.json')
64
+ @client.should_receive(:request).and_return(@edsger_dijkstra)
65
+ end
66
+
67
+ it "should execute a request for the image" do
68
+ @client.find_image('File:Edsger Wybe Dijkstra.jpg')
69
+ end
70
+
71
+ it "should return a page object" do
72
+ @client.find_image('File:Edsger Wybe Dijkstra.jpg').should be_an_instance_of(Wikipedia::Page)
73
+ end
74
+
75
+ it "should return a page with a title of File:Edsger Wybe Dijkstra.jpg" do
76
+ @page = @client.find_image('File:Edsger Wybe Dijkstra.jpg')
77
+ @page.title.should == 'File:Edsger Wybe Dijkstra.jpg'
78
+ end
79
+
80
+ it "should return a page with an image url" do
81
+ @page = @client.find_image('File:Edsger Wybe Dijkstra.jpg')
82
+ @page.image_url.should == "http://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg"
83
+ end
84
+ end
85
+
86
+ describe Wikipedia::Client, ".find page (Edsger_Dijkstra)" do
87
+ before(:each) do
88
+ @client = Wikipedia::Client.new
89
+ @client.follow_redirects = false
90
+ end
91
+
92
+ it "should get a redirect when trying Edsger Dijkstra" do
93
+ @page = @client.find('Edsger Dijkstra')
94
+ @page.should be_redirect
95
+ end
96
+
97
+ it "should get a final page when follow_redirects is true" do
98
+ @client.follow_redirects = true
99
+ @page = @client.find('Edsger Dijkstra')
100
+ @page.should_not be_redirect
101
+ end
102
+
103
+ it "should collect the image urls" do
104
+ @client.follow_redirects = true
105
+ @page = @client.find('Edsger Dijkstra')
106
+ @page.image_urls.should == ["http://upload.wikimedia.org/wikipedia/commons/d/d9/Edsger_Wybe_Dijkstra.jpg"]
107
+ end
108
+ end
@@ -0,0 +1,14 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require 'json'
3
+
4
+ describe Wikipedia::Page, ".sanitize wiki markup" do
5
+ Dir[File.dirname(__FILE__) + '/../fixtures/sanitization_samples/*-raw.txt'].each do |raw_filename|
6
+ name = raw_filename.sub(/\/(.+?)\-raw\.txt$/, '\1')
7
+ sanitized_filename = raw_filename.sub('-raw', '-sanitized')
8
+ it "should sanitize #{name} properly" do
9
+ @raw = File.read(raw_filename)
10
+ @sanitized = File.read(sanitized_filename).strip
11
+ Wikipedia::Page.sanitize(@raw).strip.should == @sanitized
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Wikipedia::Url, "like http://en.wikipedia.org/wiki/Getting_Things_Done" do
4
+ it "should have a title of Getting_Things_Done" do
5
+ url = Wikipedia::Url.new('http://en.wikipedia.org/wiki/Getting_Things_Done')
6
+ url.title.should == 'Getting_Things_Done'
7
+ end
8
+ end
@@ -0,0 +1,20 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Wikipedia, ".find" do
4
+ it "should return a Wikipedia::Page instance" do
5
+ page = Wikipedia.find('Getting_Things_Done')
6
+ page.should be_an_instance_of(Wikipedia::Page)
7
+ end
8
+
9
+ it "should return a Page with a title" do
10
+ page = Wikipedia.find('Getting_Things_Done')
11
+ page.title.should_not be_nil
12
+ end
13
+
14
+ it "should return a Page given a URL" do
15
+ page1 = Wikipedia.find('Getting_Things_Done')
16
+
17
+ page2 = Wikipedia.find('http://en.wikipedia.org/wiki/Getting_Things_Done')
18
+ page1.title.should == page2.title
19
+ end
20
+ end
@@ -0,0 +1,4 @@
1
+ require 'rubygems'
2
+ require 'spec'
3
+
4
+ require File.dirname(__FILE__) + '/../lib/wikipedia'
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :wikipedia do
3
+ # # Task goes here
4
+ # end
data/uninstall.rb ADDED
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
@@ -0,0 +1,96 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{wikipedia-client}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Cyril David", "Ken Pratt"]
12
+ s.date = %q{2010-08-09}
13
+ s.description = %q{Ruby client for the Wikipedia API}
14
+ s.email = %q{christian.hellsten@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.textile"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "MIT-LICENSE",
21
+ "README.textile",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "init.rb",
25
+ "install.rb",
26
+ "lib/wikipedia.rb",
27
+ "lib/wikipedia/client.rb",
28
+ "lib/wikipedia/configuration.rb",
29
+ "lib/wikipedia/page.rb",
30
+ "lib/wikipedia/url.rb",
31
+ "script/add_sanitization_test",
32
+ "spec/fixtures/Edsger_Dijkstra.json",
33
+ "spec/fixtures/Edsger_Dijkstra.yaml",
34
+ "spec/fixtures/Edsger_Dijkstra_section_0.json",
35
+ "spec/fixtures/Edsger_content.txt",
36
+ "spec/fixtures/File_Edsger_Wybe_Dijkstra_jpg.json",
37
+ "spec/fixtures/sanitization_samples/Ceawlin_of_Wessex-raw.txt",
38
+ "spec/fixtures/sanitization_samples/Ceawlin_of_Wessex-sanitized.txt",
39
+ "spec/fixtures/sanitization_samples/Edsger_W_Dijkstra-raw.txt",
40
+ "spec/fixtures/sanitization_samples/Edsger_W_Dijkstra-sanitized.txt",
41
+ "spec/fixtures/sanitization_samples/Flower_video_game-raw.txt",
42
+ "spec/fixtures/sanitization_samples/Flower_video_game-sanitized.txt",
43
+ "spec/fixtures/sanitization_samples/How_to_Lose_Friends__Alienate_People_film-raw.txt",
44
+ "spec/fixtures/sanitization_samples/How_to_Lose_Friends__Alienate_People_film-sanitized.txt",
45
+ "spec/fixtures/sanitization_samples/Kirsten_Dunst-raw.txt",
46
+ "spec/fixtures/sanitization_samples/Kirsten_Dunst-sanitized.txt",
47
+ "spec/fixtures/sanitization_samples/Large_Hadron_Collider-raw.txt",
48
+ "spec/fixtures/sanitization_samples/Large_Hadron_Collider-sanitized.txt",
49
+ "spec/fixtures/sanitization_samples/Metro_Goldwyn_Mayer-raw.txt",
50
+ "spec/fixtures/sanitization_samples/Metro_Goldwyn_Mayer-sanitized.txt",
51
+ "spec/fixtures/sanitization_samples/Middle_Ages-raw.txt",
52
+ "spec/fixtures/sanitization_samples/Middle_Ages-sanitized.txt",
53
+ "spec/fixtures/sanitization_samples/SMS_Elbing-raw.txt",
54
+ "spec/fixtures/sanitization_samples/SMS_Elbing-sanitized.txt",
55
+ "spec/fixtures/sanitization_samples/Sashimi-raw.txt",
56
+ "spec/fixtures/sanitization_samples/Sashimi-sanitized.txt",
57
+ "spec/fixtures/sanitization_samples/Superb_Fairywren-raw.txt",
58
+ "spec/fixtures/sanitization_samples/Superb_Fairywren-sanitized.txt",
59
+ "spec/fixtures/sanitization_samples/Velociraptor-raw.txt",
60
+ "spec/fixtures/sanitization_samples/Velociraptor-sanitized.txt",
61
+ "spec/lib/client_spec.rb",
62
+ "spec/lib/sanitize_spec.rb",
63
+ "spec/lib/url_spec.rb",
64
+ "spec/lib/wikipedia_spec.rb",
65
+ "spec/spec_helper.rb",
66
+ "tasks/wikipedia_tasks.rake",
67
+ "uninstall.rb",
68
+ "wikipedia-client.gemspec"
69
+ ]
70
+ s.homepage = %q{http://github.com/christianhellsten/wikipedia-client}
71
+ s.rdoc_options = ["--charset=UTF-8"]
72
+ s.require_paths = ["lib"]
73
+ s.rubygems_version = %q{1.3.7}
74
+ s.summary = %q{Ruby client for the Wikipedia API}
75
+ s.test_files = [
76
+ "spec/lib/client_spec.rb",
77
+ "spec/lib/sanitize_spec.rb",
78
+ "spec/lib/url_spec.rb",
79
+ "spec/lib/wikipedia_spec.rb",
80
+ "spec/spec_helper.rb"
81
+ ]
82
+
83
+ if s.respond_to? :specification_version then
84
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
85
+ s.specification_version = 3
86
+
87
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
88
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
89
+ else
90
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
91
+ end
92
+ else
93
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
94
+ end
95
+ end
96
+