wikiwhat 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +60 -16
- data/lib/wikiwhat/api_call.rb +5 -1
- data/lib/wikiwhat/page.rb +19 -3
- data/lib/wikiwhat/parse.rb +56 -48
- data/lib/wikiwhat/version.rb +1 -1
- data/spec/api_call_spec.rb +13 -1
- data/spec/fixtures/vcr_cassettes/albert.yml +33 -20
- data/spec/fixtures/vcr_cassettes/image_thumbnail.yml +66 -0
- data/spec/page_spec.rb +34 -0
- data/spec/parse_spec.rb +12 -5
- data/spec/testfiles/api_call_contents.rb +203 -2
- metadata +23 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: faf466d19aa0bf296b15260e4b848835436023c4
|
|
4
|
+
data.tar.gz: d2c642e69b806ddca33a54d67689438a9fd7dc56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bf94ba96d828be6d9e517ed187bb1af633cc5fac8266ff143ab70c9f0425c70c3869d31d394d2ecfb905c4e434812474e8ee6c6a1711dc6116d6edb207f55ce
|
|
7
|
+
data.tar.gz: e196a79dedef9a60d0ad349807d40783e87a1eb7d0d58911eeb1ca03707da8b8c24ece3cd23bdd383a46190aa79e156fa2372a645283876ba929566c83848d45
|
data/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Or install it yourself as:
|
|
|
31
31
|
|
|
32
32
|
This gem makes use of [Wikipedia](http://wikipedia.com), which is a Creative Commons resource. Please check out the [Wikipedia Copyright](http://en.wikipedia.org/wiki/Wikipedia:Copyrights) page for licensing information.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
#####To create a new Wikiwhat::Page object:
|
|
35
35
|
|
|
36
36
|
Each article to be queried should be set up as a new Wikiwhat::Page object. Queries are made via the Wikipedia API, which has limited redirect capabilities. Misspelled or ambiguious titles may return unexpected results.
|
|
37
37
|
|
|
@@ -46,17 +46,18 @@ pigeon = Wikiwhat::Page.new("Columba livia")
|
|
|
46
46
|
albert = Wikiwhat::Page.new("Albert Einstein")
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
#####Types of infomation available:
|
|
50
50
|
|
|
51
|
-
* Paragraph(s) in an article
|
|
52
|
-
* All paragraphs under a specific header
|
|
53
|
-
* A list of all image titles and corresponding URLs found in an article
|
|
54
|
-
* The sidebar image
|
|
55
|
-
*
|
|
51
|
+
* [Paragraph(s) in an article](#to-get-the-first-several-paragraphs-in-an-article)
|
|
52
|
+
* [All paragraphs under a specific header](#to get all the paragraphs under a specific header)
|
|
53
|
+
* [A list of all image titles and corresponding URLs found in an article](#to get a list of all the images on a page, plus their urls)
|
|
54
|
+
* [The sidebar image](#to-get-the-sidebar-image)
|
|
55
|
+
* [The sidebar image as a thumbnail](#to-get-the-sidebar-image-as-a-thumbnail)
|
|
56
|
+
* [A list of all references found in an article](#to-get-a-list-of-all-the-references-on-a-page)
|
|
56
57
|
|
|
57
58
|
These methods must be done independently. We currently do not support setting multiple options at once in a single new Wikiwhat object. However, the indivudual methods can all be called on the same instance of Wikiwhat::Page.
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
#####To get the first several paragraphs in an article:
|
|
60
61
|
|
|
61
62
|
```ruby
|
|
62
63
|
page = Wikiwhat::Page.new("<WIKIPEDIA ARTICLE TITLE>", :paragraphs => NUMBER)
|
|
@@ -85,12 +86,12 @@ Example 2:
|
|
|
85
86
|
|
|
86
87
|
```ruby
|
|
87
88
|
pigeon = Wikiwhat::Page.new("Columba livia")
|
|
88
|
-
pigeon.
|
|
89
|
+
pigeon.paragraphs
|
|
89
90
|
|
|
90
91
|
=> ["<p>The <b>Rock Dove</b> (<i>Columba livia</i>) or <b>Rock Pigeon</b> is a member of the bird family Columbidae (doves and pigeons). In common usage, this bird is often simply referred to as the \"pigeon\".</p>"]
|
|
91
92
|
```
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
#####To get all the paragraphs under a specific header:
|
|
94
95
|
|
|
95
96
|
```ruby
|
|
96
97
|
page = Wikiwhat::Page.new("<WIKIPEDIA ARTICLE TITLE>", :header => "<Header>")
|
|
@@ -110,19 +111,19 @@ Example 1:
|
|
|
110
111
|
|
|
111
112
|
```ruby
|
|
112
113
|
pigeon = Wikiwhat::Page.new("Columba livia", :header => "Description")
|
|
113
|
-
|
|
114
|
+
|
|
114
115
|
=> "\n\n<p>The adult of the nominate subspecies of the Rock Dove is 29 to 37 cm (11 to 15 in) long with a 62 to 72 cm (24 to 28 in) wingspan. Weight for wild or feral Rock Doves ranges from 238–380 g (8.4–13 oz), though . . ."
|
|
115
116
|
```
|
|
116
117
|
Example 2:
|
|
117
118
|
|
|
118
119
|
```ruby
|
|
119
120
|
pigeon = Wikiwhat::Page.new("Columba livia")
|
|
120
|
-
pigeon.
|
|
121
|
+
pigeon.header("Predators")
|
|
121
122
|
|
|
122
123
|
=> "\n<p>With only its flying abilities protecting it from predation, rock pigeons are a favorite almost around the world for a wide range of raptorial birds. In fact, with feral pigeons existing in most every city in the world, they may form the majority of prey for several . . ."
|
|
123
124
|
```
|
|
124
125
|
|
|
125
|
-
|
|
126
|
+
#####To get a list of all the images on a page, plus their URLs:
|
|
126
127
|
|
|
127
128
|
```ruby
|
|
128
129
|
page = Wikiwhat::Page.new("<WIKIPEDIA ARTICLE TITLE>", :img_list => true)
|
|
@@ -169,7 +170,7 @@ Example 2:
|
|
|
169
170
|
|
|
170
171
|
```ruby
|
|
171
172
|
pigeon = Wikiwhat::Page.new("Columba livia")
|
|
172
|
-
pigeon.
|
|
173
|
+
pigeon.image_list
|
|
173
174
|
|
|
174
175
|
=> {:urls=>
|
|
175
176
|
["http://upload.wikimedia.org/wikipedia/commons/4/43/Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg",
|
|
@@ -179,7 +180,7 @@ pigeon.find_image_list
|
|
|
179
180
|
]
|
|
180
181
|
```
|
|
181
182
|
|
|
182
|
-
|
|
183
|
+
#####To get the sidebar image:
|
|
183
184
|
|
|
184
185
|
```ruby
|
|
185
186
|
page = Wikiwhat::Page.new("<WIKIPEDIA ARTICLE TITLE>", :sidebar_img => true)
|
|
@@ -193,7 +194,50 @@ page.sidebar_image
|
|
|
193
194
|
|
|
194
195
|
This method returns the url of the sidebar image as a String. The url is stored under the instance variable `@sidebar_img`.
|
|
195
196
|
|
|
196
|
-
|
|
197
|
+
#####To get the sidebar image as a thumbnail:
|
|
198
|
+
|
|
199
|
+
```ruby
|
|
200
|
+
page = Wikiwhat::Page.new("<WIKIPEDIA ARTICLE TITLE>", :sidebar_thumb => { :width => <WIDTH IN PX>} )
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
or:
|
|
204
|
+
|
|
205
|
+
```ruby
|
|
206
|
+
page = Wikiwhat::Page.new("<WIKIPEDIA ARTICLE TITLE>", :sidebar_thumb => { :height => <HEIGHT IN PX>} )
|
|
207
|
+
```
|
|
208
|
+
Specify height OR width, not both. The image url that is returned is not always exactly the dimensions specified.
|
|
209
|
+
|
|
210
|
+
You can also call '.sidebar_thumbnail' directly on your Wikiwhat::Page object.
|
|
211
|
+
|
|
212
|
+
```ruby
|
|
213
|
+
page.sidebar_thumbnail( :height => <HEIGHT IN PX> )
|
|
214
|
+
page.sidebar_thumbnail( :width => <WIDTH IN PX> )
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Example 1:
|
|
218
|
+
|
|
219
|
+
```ruby
|
|
220
|
+
pigeon = Wikiwhat::Page.new("Columba livia", :sidebar_thumb => { :width => 250 })
|
|
221
|
+
|
|
222
|
+
=> #<Wikiwhat::Page:0x007fd10c3bdd98
|
|
223
|
+
@sidebar_thumbnail=
|
|
224
|
+
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg/250px-Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg",
|
|
225
|
+
@title="Columba livia">
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Example 2:
|
|
229
|
+
|
|
230
|
+
```ruby
|
|
231
|
+
pigeon = Wikiwhat::Page.new("Columba livia")
|
|
232
|
+
pigeon.sidebar_thumbnail(:width => 250)
|
|
233
|
+
|
|
234
|
+
=> #<Wikiwhat::Page:0x007fd10c3bdd98
|
|
235
|
+
@sidebar_thumbnail=
|
|
236
|
+
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg/250px-Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg",
|
|
237
|
+
@title="Columba livia">
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#####To get a list of all the references on a page:
|
|
197
241
|
|
|
198
242
|
Here there be dragons. This method is a work in progress and only works on some pages.
|
|
199
243
|
|
data/lib/wikiwhat/api_call.rb
CHANGED
|
@@ -12,8 +12,12 @@ module Wikiwhat
|
|
|
12
12
|
options[:rvprop] ? rvprop = "&rvprop=content" : rvprop = ''
|
|
13
13
|
options[:img_list] ? img_list = "&generator=images" : img_list = ''
|
|
14
14
|
options[:iiprop] ? iiprop = "&iiprop=url" : iiprop = ''
|
|
15
|
+
options[:inprop] ? inprop = "&inprop=url" : inprop = ''
|
|
16
|
+
options[:iiurlwidth] ? iiurlwidth = "&iiurlwidth=#{options[:iiurlwidth]}" : iipropwidth = ''
|
|
17
|
+
options[:iiurlheight] ? iiurlheight = "&iiurlheight=#{options[:iiurlheight]}" : iipropheight = ''
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
|
|
20
|
+
JSON.parse(RestClient.get "http://en.wikipedia.org/w/api.php?action=query#{prop}&titles=#{title}&format=json&redirects#{img_list}#{rvprop}#{iiprop}#{iiurlwidth}#{iiurlheight}#{inprop}")
|
|
17
21
|
end
|
|
18
22
|
end
|
|
19
23
|
end
|
data/lib/wikiwhat/page.rb
CHANGED
|
@@ -5,7 +5,7 @@ require 'wikiwhat/api_call'
|
|
|
5
5
|
module Wikiwhat
|
|
6
6
|
class Page
|
|
7
7
|
attr_reader :head, :header, :image_list, :title, :img_list,
|
|
8
|
-
:sidebar_img_url, :ref_list, :paragraphs
|
|
8
|
+
:sidebar_img_url, :ref_list, :paragraphs, :sidebar_thumbnail
|
|
9
9
|
|
|
10
10
|
# Set title of article and type of information requested.
|
|
11
11
|
#
|
|
@@ -25,6 +25,7 @@ module Wikiwhat
|
|
|
25
25
|
def initialize(title, options={})
|
|
26
26
|
@title = title
|
|
27
27
|
run(options)
|
|
28
|
+
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
# Iterates over the options hash.
|
|
@@ -40,13 +41,15 @@ module Wikiwhat
|
|
|
40
41
|
when:header
|
|
41
42
|
header(value)
|
|
42
43
|
when:refs
|
|
43
|
-
|
|
44
|
+
ref_list
|
|
44
45
|
when:sidebar_img
|
|
45
46
|
sidebar_image
|
|
46
47
|
when:num_paragraphs
|
|
47
48
|
paragraphs(value)
|
|
48
49
|
when:sidebar
|
|
49
50
|
sidebar_image
|
|
51
|
+
when:sidebar_thumb
|
|
52
|
+
sidebar_thumbnail(:width => value[:width], :height => value[:height])
|
|
50
53
|
end
|
|
51
54
|
end
|
|
52
55
|
end
|
|
@@ -74,6 +77,10 @@ module Wikiwhat
|
|
|
74
77
|
@sidebar_image ||= find_sidebar_image
|
|
75
78
|
end
|
|
76
79
|
|
|
80
|
+
def sidebar_thumbnail(options={})
|
|
81
|
+
@sidebar_thumbnail ||= find_sidebar_thumbnail(options)
|
|
82
|
+
end
|
|
83
|
+
|
|
77
84
|
private
|
|
78
85
|
|
|
79
86
|
# Finds the specified number of paragraphs on a page starting at the top.
|
|
@@ -90,7 +97,7 @@ module Wikiwhat
|
|
|
90
97
|
#
|
|
91
98
|
# Returns a hash with keys 'urls' and 'titles' which point to arrays of strings containg the information.
|
|
92
99
|
def find_image_list
|
|
93
|
-
api_contents = Call.call_api(@title, :img_list => true)
|
|
100
|
+
api_contents = Call.call_api(@title, :img_list => true, :inprop => true, :prop => 'info')
|
|
94
101
|
img_list = Media.new(api_contents, 'pages')
|
|
95
102
|
@image_list = img_list.list_images
|
|
96
103
|
end
|
|
@@ -122,5 +129,14 @@ module Wikiwhat
|
|
|
122
129
|
side_img_name = Text.new(api_contents, prop = 'revisions')
|
|
123
130
|
@sidebar_image = side_img_name.sidebar_image
|
|
124
131
|
end
|
|
132
|
+
|
|
133
|
+
# Find the sidebar image, if one exists.
|
|
134
|
+
#
|
|
135
|
+
# Return a String.
|
|
136
|
+
def find_sidebar_thumbnail(options = {})
|
|
137
|
+
api_contents = Call.call_api(@title, :prop => "revisions", :rvprop => true)
|
|
138
|
+
side_thumb_name = Media.new(api_contents, prop = 'revisions')
|
|
139
|
+
@sidebar_thumbnail = side_thumb_name.sidebar_image_thumbnail(:width => options[:width], :height => options[:height])
|
|
140
|
+
end
|
|
125
141
|
end
|
|
126
142
|
end
|
data/lib/wikiwhat/parse.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
require_relative 'wikierror'
|
|
2
|
+
|
|
1
3
|
module Wikiwhat
|
|
2
|
-
class WikiwhatError < StandardError
|
|
3
|
-
end
|
|
4
4
|
|
|
5
5
|
class Results
|
|
6
6
|
def initialize
|
|
@@ -22,6 +22,22 @@ module Wikiwhat
|
|
|
22
22
|
end
|
|
23
23
|
@result
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
# Splits the content into side bar and everything else.
|
|
27
|
+
# This method is for Parsing methods that use the raw markup from the
|
|
28
|
+
# revisions call.
|
|
29
|
+
# Specify start as 0 for sidebar content, for everything else specify
|
|
30
|
+
# 'content_split(1, -1)'
|
|
31
|
+
#
|
|
32
|
+
# TODO:split the content from the catagory info
|
|
33
|
+
def content_split(start, finish=nil)
|
|
34
|
+
@content = @request.split("'''")
|
|
35
|
+
if finish == nil
|
|
36
|
+
@content[start]
|
|
37
|
+
else
|
|
38
|
+
@content[start..finish].join
|
|
39
|
+
end
|
|
40
|
+
end
|
|
25
41
|
end
|
|
26
42
|
|
|
27
43
|
# Extract portions of text from Wiki article
|
|
@@ -102,13 +118,14 @@ module Wikiwhat
|
|
|
102
118
|
# Return the url of the image as a String.
|
|
103
119
|
def sidebar_image
|
|
104
120
|
# Check to see if a sidebar image exists
|
|
105
|
-
if content_split(0)[/(image
|
|
121
|
+
if self.content_split(0)[/(image).*?(\.\w\w(g|G|f|F))/]
|
|
106
122
|
# Grab the sidebar image title
|
|
107
|
-
image_name = content_split(0)[/(image
|
|
123
|
+
image_name = self.content_split(0)[/(image).*?(\.\w\w(g|G|f|F))/]
|
|
108
124
|
# Remove the 'image = ' part of the string
|
|
109
|
-
image_name = image_name.split("=
|
|
125
|
+
image_name = image_name.split("=")[1].strip
|
|
110
126
|
# Call Wikipedia for image url
|
|
111
|
-
get_url = Wikiwhat::Call.call_api(('File:'+ image_name),
|
|
127
|
+
get_url = Wikiwhat::Call.call_api(('File:'+ image_name),
|
|
128
|
+
:prop => "imageinfo", :iiprop => true)
|
|
112
129
|
# Pull url from hash
|
|
113
130
|
img_name_2 = pull_from_hash(get_url, "pages")
|
|
114
131
|
img_array = pull_from_hash(img_name_2, "imageinfo")
|
|
@@ -132,28 +149,16 @@ module Wikiwhat
|
|
|
132
149
|
@content.scan(/<ref>(.*?)<\/ref>/)
|
|
133
150
|
end
|
|
134
151
|
|
|
135
|
-
|
|
136
|
-
# Splits the content into side bar and everything else.
|
|
137
|
-
# This method is for Parsing methods that use the raw markup from the
|
|
138
|
-
# revisions call.
|
|
139
|
-
# Specify start as 0 for sidebar content, for everything else specify
|
|
140
|
-
# 'content_split(1, -1)'
|
|
141
|
-
#
|
|
142
|
-
# TODO:split the content from the catagory info
|
|
143
|
-
def content_split(start, finish=nil)
|
|
144
|
-
@content = @request.split("'''")
|
|
145
|
-
if finish == nil
|
|
146
|
-
@content[start]
|
|
147
|
-
else
|
|
148
|
-
@content[start..finish].join
|
|
149
|
-
end
|
|
150
|
-
end
|
|
152
|
+
|
|
151
153
|
end
|
|
152
154
|
|
|
153
155
|
class Media < Results
|
|
154
156
|
attr_reader :api_return
|
|
155
157
|
def initialize(api_return, prop)
|
|
156
158
|
@request = self.pull_from_hash(api_return, prop)
|
|
159
|
+
if @request.class == Array
|
|
160
|
+
@request = self.pull_from_hash(@request[0], "*")
|
|
161
|
+
end
|
|
157
162
|
end
|
|
158
163
|
|
|
159
164
|
# Find all the media items on a page.
|
|
@@ -163,37 +168,40 @@ module Wikiwhat
|
|
|
163
168
|
# Call API for initial list of images
|
|
164
169
|
isolated_list = @request
|
|
165
170
|
# Parse JSON object for list of image titles
|
|
166
|
-
|
|
171
|
+
image_array = []
|
|
167
172
|
isolated_list.collect do |key, value|
|
|
168
|
-
|
|
173
|
+
image_array << {"title" => value["title"], "url" => value["fullurl"] }
|
|
169
174
|
end
|
|
170
175
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
image_title_array.each do |title|
|
|
174
|
-
img_url_call_array << Wikiwhat::Call.call_api(title,
|
|
175
|
-
:prop => "imageinfo", :iiprop => true)
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
# Pull pages object containing imageinfo array out from JSON object
|
|
179
|
-
imageinfo_array = []
|
|
180
|
-
img_url_call_array.each do |object|
|
|
181
|
-
imageinfo_array << pull_from_hash(object, "pages")
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
# Pull imageinfo array out of nested hash
|
|
185
|
-
info_array = []
|
|
186
|
-
imageinfo_array.each do |object|
|
|
187
|
-
info_array << pull_from_hash(object, "imageinfo")
|
|
188
|
-
end
|
|
176
|
+
return image_array
|
|
177
|
+
end
|
|
189
178
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
179
|
+
# Find the image from the sidebar, if one exists
|
|
180
|
+
#
|
|
181
|
+
# Return the url of the thumbnail image as a String.
|
|
182
|
+
def sidebar_image_thumbnail(options={})
|
|
183
|
+
# Check to see if a sidebar image exists
|
|
184
|
+
if self.content_split(0)[/(image).*?(\.\w\w(g|G|f|F))/]
|
|
185
|
+
# Grab the sidebar image title
|
|
186
|
+
image_name = self.content_split(0)[/(image).*?(\.\w\w(g|G|f|F))/]
|
|
187
|
+
# Remove the 'image = ' part of the string
|
|
188
|
+
image_name = image_name.split("=")[1].strip
|
|
189
|
+
# Call Wikipedia for image url
|
|
190
|
+
get_url = Wikiwhat::Call.call_api(('File:'+ image_name),
|
|
191
|
+
:prop => "imageinfo",
|
|
192
|
+
:iiprop => true,
|
|
193
|
+
:iiurlwidth => options[:width],
|
|
194
|
+
:iiurlheight => options[:height] )
|
|
195
|
+
# Pull url from hash
|
|
196
|
+
img_name_2 = pull_from_hash(get_url, "pages")
|
|
197
|
+
img_array = pull_from_hash(img_name_2, "imageinfo")
|
|
198
|
+
img_array[0]["thumburl"]
|
|
199
|
+
else
|
|
200
|
+
# If no sidebar image exists, raise error.
|
|
201
|
+
raise Wikiwhat::WikiwhatError.new("Sorry, it looks like there is no sidebar image
|
|
202
|
+
on this page.")
|
|
194
203
|
end
|
|
195
|
-
|
|
196
|
-
return {urls: url_array, titles: image_title_array }
|
|
197
204
|
end
|
|
205
|
+
|
|
198
206
|
end
|
|
199
207
|
end
|
data/lib/wikiwhat/version.rb
CHANGED
data/spec/api_call_spec.rb
CHANGED
|
@@ -37,7 +37,7 @@ describe Wikiwhat::Call do
|
|
|
37
37
|
context 'image list call' do
|
|
38
38
|
it "forms the call string & uses RestClient to make API call" do
|
|
39
39
|
VCR.use_cassette('albert') do
|
|
40
|
-
api_output = Wikiwhat::Call.call_api('Albert Einstien', img_list:true)
|
|
40
|
+
api_output = Wikiwhat::Call.call_api('Albert Einstien', img_list:true, inprop:true, prop:"info")
|
|
41
41
|
|
|
42
42
|
expect(api_output).to be_a(Hash)
|
|
43
43
|
expect(api_output).to eq(img_output)
|
|
@@ -56,5 +56,17 @@ describe Wikiwhat::Call do
|
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
|
+
|
|
60
|
+
context 'image thumbnail call' do
|
|
61
|
+
it "uses RestClient to make API call" do
|
|
62
|
+
VCR.use_cassette('image_thumbnail') do
|
|
63
|
+
api_output = Wikiwhat::Call.call_api("File:Kelmitchellpic.jpg",
|
|
64
|
+
prop:"imageinfo", iiprop:true, iiurlwidth:250)
|
|
65
|
+
|
|
66
|
+
expect(api_output).to be_a(Hash)
|
|
67
|
+
expect(api_output).to eq(apispec_img_thumbnail)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
59
71
|
end
|
|
60
72
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
http_interactions:
|
|
3
3
|
- request:
|
|
4
4
|
method: get
|
|
5
|
-
uri: http://en.wikipedia.org/w/api.php?action=query&format=json&generator=images&redirects&titles=Albert%20Einstien
|
|
5
|
+
uri: http://en.wikipedia.org/w/api.php?action=query&format=json&generator=images&inprop=url&prop=info&redirects&titles=Albert%20Einstien
|
|
6
6
|
body:
|
|
7
7
|
encoding: US-ASCII
|
|
8
8
|
string: ''
|
|
@@ -18,10 +18,10 @@ http_interactions:
|
|
|
18
18
|
code: 200
|
|
19
19
|
message: OK
|
|
20
20
|
headers:
|
|
21
|
-
Date:
|
|
22
|
-
- Wed, 30 Oct 2013 02:28:35 GMT
|
|
23
21
|
Server:
|
|
24
22
|
- Apache
|
|
23
|
+
X-Powered-By:
|
|
24
|
+
- PHP/5.3.10-1ubuntu3.8+wmf2
|
|
25
25
|
X-Content-Type-Options:
|
|
26
26
|
- nosniff
|
|
27
27
|
Cache-Control:
|
|
@@ -30,30 +30,43 @@ http_interactions:
|
|
|
30
30
|
- SAMEORIGIN
|
|
31
31
|
Vary:
|
|
32
32
|
- Accept-Encoding,X-Forwarded-Proto
|
|
33
|
+
X-Vary-Options:
|
|
34
|
+
- Accept-Encoding;list-contains=gzip,X-Forwarded-Proto,Cookie;string-contains=enwikiToken;string-contains=enwikiLoggedOut;string-contains=forceHTTPS;string-contains=enwikiSession;string-contains=centralauth_Token;string-contains=centralauth_Session;string-contains=centralauth_LoggedOut;string-contains=mf_useformat;string-contains=stopMobileRedirect
|
|
33
35
|
Content-Encoding:
|
|
34
36
|
- gzip
|
|
35
|
-
Content-Length:
|
|
36
|
-
- '287'
|
|
37
37
|
Content-Type:
|
|
38
38
|
- application/json; charset=utf-8
|
|
39
|
-
X-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
39
|
+
X-Varnish:
|
|
40
|
+
- 1128156410, 1247256599
|
|
41
|
+
Via:
|
|
42
|
+
- 1.1 varnish, 1.1 varnish
|
|
43
|
+
Content-Length:
|
|
44
|
+
- '511'
|
|
45
|
+
Accept-Ranges:
|
|
46
|
+
- bytes
|
|
47
|
+
Date:
|
|
48
|
+
- Thu, 12 Dec 2013 23:03:52 GMT
|
|
49
|
+
Age:
|
|
50
|
+
- '0'
|
|
45
51
|
Connection:
|
|
46
|
-
-
|
|
52
|
+
- keep-alive
|
|
53
|
+
X-Cache:
|
|
54
|
+
- cp1053 miss (0), cp1054 frontend miss (0)
|
|
47
55
|
body:
|
|
48
56
|
encoding: ASCII-8BIT
|
|
49
57
|
string: !binary |-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
H4sIAAAAAAAAA82W7W7TMBSGb8WKBHRSm8zt6Jc0IYRA/OIWLC85dQ44tomd
|
|
59
|
+
0TF279gt2ZIFtmwKhPxI/Pn68SPLynX0tYLyapZq5VBVEG2vIyy4ABtKAou7
|
|
60
|
+
jmi1WP54hw6/g5q9R2UdoIo/GxHd3EyPMWGOqSfPaHgrX15OI4dOhowPKGFL
|
|
61
|
+
N3RDIJVoLBCjrc+8hEPSNCrQWlTCD/WVsDgoV+gMpG/5hl/Qwd75nrCK5EpU
|
|
62
|
+
/ut7QPm2XSVlVYaBuXNmmySg4jDFQIY81qVIQi25RWC/ENg9BD/cPZKToMpg
|
|
63
|
+
H5vcvDns7Pzh0Jc8dajVeUiOvKzZ/E9q3soLKB2p9b6yBPa8IHpHCu6h0F0R
|
|
64
|
+
UfIMLJmkWupyfvJvvR35WM33Yr6yLBAyvWM1ITsSsnuEz9b63DU71hc9rZPJ
|
|
65
|
+
J30B8iQ2ajy1rA0xlL1mbEfQWV9BH4Fnox481iAYTE2d2fHyuq8XbgknaY5y
|
|
66
|
+
ZDvcMs6aHIM5aid3TC17m3LE5UD8fsPl5vISgEzoej3yhca4Y56L+bRwvRy4
|
|
67
|
+
WItrOJMPrtQxu+prVkBZcBVrMaLFFsNgxu5SO3bWfe2YXDtN6GZ+Ou45O3Cw
|
|
68
|
+
BsdgltrJHVObJ5ui/4kp+tdM0d+aoqd9VVkUKvyIgNe1OIvt5Yi6bllYg2Uw
|
|
69
|
+
Zd30tjb//ARIi6d5UwwAAA==
|
|
57
70
|
http_version:
|
|
58
|
-
recorded_at:
|
|
71
|
+
recorded_at: Thu, 12 Dec 2013 23:03:51 GMT
|
|
59
72
|
recorded_with: VCR 2.6.0
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: get
|
|
5
|
+
uri: http://en.wikipedia.org/w/api.php?action=query&format=json&iiprop=url&iiurlwidth=250&prop=imageinfo&redirects&titles=File:Kelmitchellpic.jpg
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: ''
|
|
9
|
+
headers:
|
|
10
|
+
Accept:
|
|
11
|
+
- '*/*; q=0.5, application/xml'
|
|
12
|
+
Accept-Encoding:
|
|
13
|
+
- gzip, deflate
|
|
14
|
+
User-Agent:
|
|
15
|
+
- Ruby
|
|
16
|
+
response:
|
|
17
|
+
status:
|
|
18
|
+
code: 200
|
|
19
|
+
message: OK
|
|
20
|
+
headers:
|
|
21
|
+
Server:
|
|
22
|
+
- Apache
|
|
23
|
+
X-Powered-By:
|
|
24
|
+
- PHP/5.3.10-1ubuntu3.8+wmf2
|
|
25
|
+
X-Content-Type-Options:
|
|
26
|
+
- nosniff
|
|
27
|
+
Cache-Control:
|
|
28
|
+
- private
|
|
29
|
+
X-Frame-Options:
|
|
30
|
+
- SAMEORIGIN
|
|
31
|
+
Vary:
|
|
32
|
+
- Accept-Encoding,X-Forwarded-Proto
|
|
33
|
+
X-Vary-Options:
|
|
34
|
+
- Accept-Encoding;list-contains=gzip,X-Forwarded-Proto,Cookie;string-contains=enwikiToken;string-contains=enwikiLoggedOut;string-contains=forceHTTPS;string-contains=enwikiSession;string-contains=centralauth_Token;string-contains=centralauth_Session;string-contains=centralauth_LoggedOut;string-contains=mf_useformat;string-contains=stopMobileRedirect
|
|
35
|
+
Content-Encoding:
|
|
36
|
+
- gzip
|
|
37
|
+
Content-Type:
|
|
38
|
+
- application/json; charset=utf-8
|
|
39
|
+
X-Varnish:
|
|
40
|
+
- 2362209605, 3154464337
|
|
41
|
+
Via:
|
|
42
|
+
- 1.1 varnish, 1.1 varnish
|
|
43
|
+
Content-Length:
|
|
44
|
+
- '252'
|
|
45
|
+
Accept-Ranges:
|
|
46
|
+
- bytes
|
|
47
|
+
Date:
|
|
48
|
+
- Sun, 24 Nov 2013 22:06:54 GMT
|
|
49
|
+
Age:
|
|
50
|
+
- '0'
|
|
51
|
+
Connection:
|
|
52
|
+
- keep-alive
|
|
53
|
+
X-Cache:
|
|
54
|
+
- cp1068 miss (0), cp1052 frontend miss (0)
|
|
55
|
+
body:
|
|
56
|
+
encoding: ASCII-8BIT
|
|
57
|
+
string: !binary |-
|
|
58
|
+
H4sIAAAAAAAAA62Qz07DMAzG38Xntmm7DUEegAtXTkMcSmoaQ/4tcTWhqu9O
|
|
59
|
+
0o0D0riRg+XP+fyz5QVOM8avWnnH5GYEuQDZYUJy734TlHiIDBL6tn2ou75u
|
|
60
|
+
D89tL/t72e6OsK7VhVC8IfelktRdiS7ndxUwsclceCSD8gmNJVYajQmkmo8w
|
|
61
|
+
QQWWUiI3ZU8W2/SIwSdiX7iQ9BBx/Pm6LPayAOvZvs3RZIdmDlKIORg/jM2Z
|
|
62
|
+
PsniSEPj4ySKCkUJ5a31Lgkl1F7cXGRDnmlkDbI77K8FjTTpfIFdlyv/O3DE
|
|
63
|
+
pCIFJu9+ga+dN8jirzOur2t+33pqU/3QAQAA
|
|
64
|
+
http_version:
|
|
65
|
+
recorded_at: Sun, 24 Nov 2013 22:07:04 GMT
|
|
66
|
+
recorded_with: VCR 2.6.0
|
data/spec/page_spec.rb
CHANGED
|
@@ -174,4 +174,38 @@ describe Wikiwhat::Page do
|
|
|
174
174
|
end
|
|
175
175
|
end
|
|
176
176
|
end
|
|
177
|
+
describe "#sidebar_thumbnail" do
|
|
178
|
+
context "When sidebar_thumb => {:width => 250} is specified in the options hash" do
|
|
179
|
+
it "calls Call.api" do
|
|
180
|
+
Wikiwhat::Call.stub(:call_api).and_return(wikiwhat_page_pigeon_revisions, wikiwhat_page_pigeon_sidebar_thumbnail)
|
|
181
|
+
pigeon = Wikiwhat::Page.new("Columba livia", :sidebar_thumb => {:width => 250})
|
|
182
|
+
expect(Wikiwhat::Call).to have_received(:call_api).at_least(1).times
|
|
183
|
+
end
|
|
184
|
+
it "calls #sidebar_image_thumbnail on a Wikiwhat::Media instance" do
|
|
185
|
+
Wikiwhat::Call.stub(:call_api).and_return(wikiwhat_page_pigeon_revisions, wikiwhat_page_pigeon_sidebar_thumbnail)
|
|
186
|
+
expect_any_instance_of(Wikiwhat::Media).to receive(:sidebar_image_thumbnail)
|
|
187
|
+
pigeon = Wikiwhat::Page.new("Columba livia", :sidebar_thumb => {:width => 250})
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
context "When #sidebar_thumbnail is called on a Wikiwhat::Media instance" do
|
|
191
|
+
let(:pigeon) { Wikiwhat::Page.new("Columba livia") }
|
|
192
|
+
it "calls Call.api" do
|
|
193
|
+
Wikiwhat::Call.stub(:call_api).and_return(wikiwhat_page_pigeon_revisions, wikiwhat_page_pigeon_sidebar_thumbnail)
|
|
194
|
+
pigeon.sidebar_thumbnail(:width => 250)
|
|
195
|
+
expect(Wikiwhat::Call).to have_received(:call_api).at_least(1).times
|
|
196
|
+
end
|
|
197
|
+
it "calls #sidebar_image_thumbnail on a Wikiwhat::Media instance" do
|
|
198
|
+
Wikiwhat::Call.stub(:call_api).and_return(wikiwhat_page_pigeon_revisions, wikiwhat_page_pigeon_sidebar_thumbnail)
|
|
199
|
+
expect_any_instance_of(Wikiwhat::Media).to receive(:sidebar_image_thumbnail)
|
|
200
|
+
pigeon.sidebar_thumbnail(:width => 250)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
context "When no sidebar image exists" do
|
|
204
|
+
let(:chad) { Wikiwhat::Page.new("Chad Muska") }
|
|
205
|
+
it "Raises an exception" do
|
|
206
|
+
Wikiwhat::Call.stub(:call_api).and_return(wikiwhat_page_chad_revisions)
|
|
207
|
+
expect { chad.sidebar_thumbnail(:width => 250) }.to raise_error(Wikiwhat::WikiwhatError)
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
177
211
|
end
|
data/spec/parse_spec.rb
CHANGED
|
@@ -50,16 +50,23 @@ describe Wikiwhat::Text do
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
describe Wikiwhat::Media do
|
|
53
|
-
let(:albert){Wikiwhat::Media.new(img_output, "pages")}
|
|
54
|
-
|
|
55
53
|
describe '#list_images' do
|
|
54
|
+
let(:albert){Wikiwhat::Media.new(img_output, "pages")}
|
|
55
|
+
|
|
56
56
|
it "pulls out file names and queries the api for their urls, returns an
|
|
57
57
|
array of urls" do
|
|
58
|
-
|
|
59
|
-
media_list_3, media_list_4, media_list_5, media_list_6, media_list_7,
|
|
60
|
-
media_list_8, media_list_9, media_list_10)
|
|
58
|
+
|
|
61
59
|
|
|
62
60
|
expect(albert.list_images).to eq(list_images_output)
|
|
63
61
|
end
|
|
64
62
|
end
|
|
63
|
+
|
|
64
|
+
describe '#sidebar_image_thumbnail' do
|
|
65
|
+
let(:albert) { Wikiwhat::Media.new(rev_output, "revisions") }
|
|
66
|
+
|
|
67
|
+
it "returns the URL for a thumbnail version of the sidebar image." do
|
|
68
|
+
Wikiwhat::Call.stub(:call_api).and_return(wikiwhat_parse_albert_thumbnail)
|
|
69
|
+
expect(albert.sidebar_image_thumbnail({ :iipropwidth => 200})).to eq(wikiwhat_parse_albert_thumbnail_url)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
65
72
|
end
|
|
@@ -22,7 +22,108 @@ def rev_content
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def img_output
|
|
25
|
-
|
|
25
|
+
{"query-continue"=>{"images"=>{"gimcontinue"=>"736|Citizen-Einstein.jpg"}},
|
|
26
|
+
"query"=>
|
|
27
|
+
{"pages"=>
|
|
28
|
+
{"-1"=>
|
|
29
|
+
{"ns"=>6,
|
|
30
|
+
"title"=>"File:1919 eclipse positive.jpg",
|
|
31
|
+
"missing"=>"",
|
|
32
|
+
"contentmodel"=>"wikitext",
|
|
33
|
+
"pagelanguage"=>"en",
|
|
34
|
+
"fullurl"=>
|
|
35
|
+
"http://en.wikipedia.org/wiki/File:1919_eclipse_positive.jpg",
|
|
36
|
+
"editurl"=>
|
|
37
|
+
"http://en.wikipedia.org/w/index.php?title=File:1919_eclipse_positive.jpg&action=edit"},
|
|
38
|
+
"-2"=>
|
|
39
|
+
{"ns"=>6,
|
|
40
|
+
"title"=>"File:Albert Einstein's exam of maturity grades (color2).jpg",
|
|
41
|
+
"missing"=>"",
|
|
42
|
+
"contentmodel"=>"wikitext",
|
|
43
|
+
"pagelanguage"=>"en",
|
|
44
|
+
"fullurl"=>
|
|
45
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein%27s_exam_of_maturity_grades_(color2).jpg",
|
|
46
|
+
"editurl"=>
|
|
47
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein%27s_exam_of_maturity_grades_(color2).jpg&action=edit"},
|
|
48
|
+
"-3"=>
|
|
49
|
+
{"ns"=>6,
|
|
50
|
+
"title"=>"File:Albert Einstein (Nobel).png",
|
|
51
|
+
"missing"=>"",
|
|
52
|
+
"contentmodel"=>"wikitext",
|
|
53
|
+
"pagelanguage"=>"en",
|
|
54
|
+
"fullurl"=>
|
|
55
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_(Nobel).png",
|
|
56
|
+
"editurl"=>
|
|
57
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_(Nobel).png&action=edit"},
|
|
58
|
+
"-4"=>
|
|
59
|
+
{"ns"=>6,
|
|
60
|
+
"title"=>"File:Albert Einstein Head.jpg",
|
|
61
|
+
"missing"=>"",
|
|
62
|
+
"contentmodel"=>"wikitext",
|
|
63
|
+
"pagelanguage"=>"en",
|
|
64
|
+
"fullurl"=>"http://en.wikipedia.org/wiki/File:Albert_Einstein_Head.jpg",
|
|
65
|
+
"editurl"=>
|
|
66
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_Head.jpg&action=edit"},
|
|
67
|
+
"-5"=>
|
|
68
|
+
{"ns"=>6,
|
|
69
|
+
"title"=>"File:Albert Einstein as a child.jpg",
|
|
70
|
+
"missing"=>"",
|
|
71
|
+
"contentmodel"=>"wikitext",
|
|
72
|
+
"pagelanguage"=>"en",
|
|
73
|
+
"fullurl"=>
|
|
74
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_as_a_child.jpg",
|
|
75
|
+
"editurl"=>
|
|
76
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_as_a_child.jpg&action=edit"},
|
|
77
|
+
"-6"=>
|
|
78
|
+
{"ns"=>6,
|
|
79
|
+
"title"=>"File:Albert Einstein at the age of three (1882).jpg",
|
|
80
|
+
"missing"=>"",
|
|
81
|
+
"contentmodel"=>"wikitext",
|
|
82
|
+
"pagelanguage"=>"en",
|
|
83
|
+
"fullurl"=>
|
|
84
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_at_the_age_of_three_(1882).jpg",
|
|
85
|
+
"editurl"=>
|
|
86
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_at_the_age_of_three_(1882).jpg&action=edit"},
|
|
87
|
+
"-7"=>
|
|
88
|
+
{"ns"=>6,
|
|
89
|
+
"title"=>"File:Albert Einstein german.ogg",
|
|
90
|
+
"missing"=>"",
|
|
91
|
+
"contentmodel"=>"wikitext",
|
|
92
|
+
"pagelanguage"=>"en",
|
|
93
|
+
"fullurl"=>
|
|
94
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_german.ogg",
|
|
95
|
+
"editurl"=>
|
|
96
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_german.ogg&action=edit"},
|
|
97
|
+
"-8"=>
|
|
98
|
+
{"ns"=>6,
|
|
99
|
+
"title"=>"File:Albert Einstein photo 1920.jpg",
|
|
100
|
+
"missing"=>"",
|
|
101
|
+
"contentmodel"=>"wikitext",
|
|
102
|
+
"pagelanguage"=>"en",
|
|
103
|
+
"fullurl"=>
|
|
104
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_photo_1920.jpg",
|
|
105
|
+
"editurl"=>
|
|
106
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_photo_1920.jpg&action=edit"},
|
|
107
|
+
"-9"=>
|
|
108
|
+
{"ns"=>6,
|
|
109
|
+
"title"=>"File:Albert Einstein photo 1921.jpg",
|
|
110
|
+
"missing"=>"",
|
|
111
|
+
"contentmodel"=>"wikitext",
|
|
112
|
+
"pagelanguage"=>"en",
|
|
113
|
+
"fullurl"=>
|
|
114
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_photo_1921.jpg",
|
|
115
|
+
"editurl"=>
|
|
116
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_photo_1921.jpg&action=edit"},
|
|
117
|
+
"-10"=>
|
|
118
|
+
{"ns"=>6,
|
|
119
|
+
"title"=>"File:Albert Einstein signature 1934.svg",
|
|
120
|
+
"missing"=>"",
|
|
121
|
+
"contentmodel"=>"wikitext",
|
|
122
|
+
"pagelanguage"=>"en",
|
|
123
|
+
"fullurl"=>
|
|
124
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_signature_1934.svg",
|
|
125
|
+
"editurl"=>
|
|
126
|
+
"http://en.wikipedia.org/w/index.php?title=File:Albert_Einstein_signature_1934.svg&action=edit"}}}}
|
|
26
127
|
end
|
|
27
128
|
|
|
28
129
|
def img_content
|
|
@@ -42,7 +143,29 @@ def refs_content
|
|
|
42
143
|
end
|
|
43
144
|
|
|
44
145
|
def list_images_output
|
|
45
|
-
{
|
|
146
|
+
[{"title"=>"File:1919 eclipse positive.jpg",
|
|
147
|
+
"url"=>"http://en.wikipedia.org/wiki/File:1919_eclipse_positive.jpg"},
|
|
148
|
+
{"title"=>"File:Albert Einstein's exam of maturity grades (color2).jpg",
|
|
149
|
+
"url"=>
|
|
150
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein%27s_exam_of_maturity_grades_(color2).jpg"},
|
|
151
|
+
{"title"=>"File:Albert Einstein (Nobel).png",
|
|
152
|
+
"url"=>"http://en.wikipedia.org/wiki/File:Albert_Einstein_(Nobel).png"},
|
|
153
|
+
{"title"=>"File:Albert Einstein Head.jpg",
|
|
154
|
+
"url"=>"http://en.wikipedia.org/wiki/File:Albert_Einstein_Head.jpg"},
|
|
155
|
+
{"title"=>"File:Albert Einstein as a child.jpg",
|
|
156
|
+
"url"=>"http://en.wikipedia.org/wiki/File:Albert_Einstein_as_a_child.jpg"},
|
|
157
|
+
{"title"=>"File:Albert Einstein at the age of three (1882).jpg",
|
|
158
|
+
"url"=>
|
|
159
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_at_the_age_of_three_(1882).jpg"},
|
|
160
|
+
{"title"=>"File:Albert Einstein german.ogg",
|
|
161
|
+
"url"=>"http://en.wikipedia.org/wiki/File:Albert_Einstein_german.ogg"},
|
|
162
|
+
{"title"=>"File:Albert Einstein photo 1920.jpg",
|
|
163
|
+
"url"=>"http://en.wikipedia.org/wiki/File:Albert_Einstein_photo_1920.jpg"},
|
|
164
|
+
{"title"=>"File:Albert Einstein photo 1921.jpg",
|
|
165
|
+
"url"=>"http://en.wikipedia.org/wiki/File:Albert_Einstein_photo_1921.jpg"},
|
|
166
|
+
{"title"=>"File:Albert Einstein signature 1934.svg",
|
|
167
|
+
"url"=>
|
|
168
|
+
"http://en.wikipedia.org/wiki/File:Albert_Einstein_signature_1934.svg"}]
|
|
46
169
|
end
|
|
47
170
|
|
|
48
171
|
def media_list_1
|
|
@@ -156,6 +279,26 @@ def wikiwhat_page_pigeon_sidebar_image
|
|
|
156
279
|
"http://commons.wikimedia.org/wiki/File:Blue_Rock_Pigeon_(Columba_livia)_in_Kolkata_I_IMG_9762.jpg"}]}}}}
|
|
157
280
|
end
|
|
158
281
|
|
|
282
|
+
def wikiwhat_page_pigeon_sidebar_thumbnail
|
|
283
|
+
{"query"=>
|
|
284
|
+
{"pages"=>
|
|
285
|
+
{"-1"=>
|
|
286
|
+
{"ns"=>6,
|
|
287
|
+
"title"=>
|
|
288
|
+
"File:Blue Rock Pigeon (Columba livia) in Kolkata I IMG 9762.jpg",
|
|
289
|
+
"missing"=>"",
|
|
290
|
+
"imagerepository"=>"shared",
|
|
291
|
+
"imageinfo"=>
|
|
292
|
+
[{"thumburl"=>
|
|
293
|
+
"http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg/250px-Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg",
|
|
294
|
+
"thumbwidth"=>250,
|
|
295
|
+
"thumbheight"=>265,
|
|
296
|
+
"url"=>
|
|
297
|
+
"http://upload.wikimedia.org/wikipedia/commons/4/43/Blue_Rock_Pigeon_%28Columba_livia%29_in_Kolkata_I_IMG_9762.jpg",
|
|
298
|
+
"descriptionurl"=>
|
|
299
|
+
"http://commons.wikimedia.org/wiki/File:Blue_Rock_Pigeon_(Columba_livia)_in_Kolkata_I_IMG_9762.jpg"}]}}}}
|
|
300
|
+
end
|
|
301
|
+
|
|
159
302
|
def wikiwhat_page_chad_revisions
|
|
160
303
|
{"query"=>
|
|
161
304
|
{"pages"=>
|
|
@@ -169,3 +312,61 @@ def wikiwhat_page_chad_revisions
|
|
|
169
312
|
"*"=>
|
|
170
313
|
"{{BLP sources|date= March 2013}}\n{{Infobox sportsperson \n| name = Chad Muska\n| image_size = \n| birth_date = {{birth date and age|mf=yes|1977|5|20}}\n| birth_place = [[Lorain, Ohio|Lorain]], [[Ohio]], [[United States]]\n| residence = [[New York City|New York]], [[New York]], [[United States]]\n| occupation = Skateboarder/Artist\n| spouse = \n| net worth = \n| website = [http://www.themuska.com/ themuska.com]\n| profession = [[Skateboard]]er\n}}\n'''Chad Muska''' (born May 20, 1977) is an American professional [[Skateboarding|skateboarder]], artist, and entrepreneur.<ref name=\"Factory\" /> In November 2012, Skin Phillips (Editor-in-chief of ''Transworld SKATEboarding'' magazine) described Muska as \"one of the most marketable pros skateboarding has ever seen\".<ref name=\"Skin\">{{cite web|title=30TH ANNIVERSARY INTERVIEWS: CHAD MUSKA PART 1|url=http://skateboarding.transworld.net/1000168419/videos/30th-anniversary-interviews-chad-muska-part-1/|work=Transworld SKATEboarding|publisher=Bonnier Corporation|accessdate=17 March 2013|author=Skin Phillips|format=Video upload|date=20|month=November|year=2012}}</ref>\n\n==Early life==\nMuska first became interested in skateboarding as a young person following a relocation to [[Phoenix, Arizona|Phoenix]], [[Arizona]], United States (US) where his father was residing at the time.<ref name=\"Skin\" /> Muska explained in a 2012 interview:\n\n<blockquote>\nI was riding my BMX bike a lot and then there were some neighborhood kids that would, kinda, skate and I would check them out; and I used to come home from school every day and just stare at 'em, you know? And I would walk by and just watch them skate. They told me this story ... I guess I'd be, like, \"Hey, let me try your board\", and I would grab their board and would just try and boardslide the curb and go all crazy on it ... Something happened, my bike got stolen, and I got a board off one of the kids, and, from that moment on, it was just, like, full blown ...<ref name=\"Skin\" /></blockquote>\n\nWhile in Arizona, Muska first met and spent time skateboarding with professional skateboarder [[Erik Ellington]] prior to both of their careers. Muska eventually moved to [[Mission Beach, San Diego|Mission Beach]] in [[San Diego]], [[California]], US with very little money, a sketch book, and a portable cassette player to further pursue skateboarding and art.<ref name=\"Skin\" />\n\n==Professional skateboarding==\nAfter his inclusion in the \"30 Most Influential Skaters of All Time\" list released by ''Transworld SKATEboarding'' magazine,<ref name=\"Most\" /> Muska explained that his first influences were sponsored skateboarders in his local area.<ref name=\"Skin\" /> Muska has ridden for now-defunct companies TSA Clothing, Diakka Watches, and Ghetto Child Wheels. Other past sponsors include [[Toy Machine]], Maple, [[Etnies]], Shorty's Skateboards and Fury skateboard trucks.\n\n===Shorty's===\n{{Expand section|date=March 2013}}\nMuska is popularly known for his part in the 1998 skateboarding video ''Fulfill The Dream'', produced by the Shorty's company—Muska appeared in a total of four videos for the company.<ref name=\"Vids\" />\n\n===éS===\nMuska was sponsored by the éS [[skate shoe]] company (manufactured and distributed by the [[Sole Technology|Sole Technology, Inc.]] company) prior to the turn of the 21st century; when the \"éS Muska\" signature model was released in 1998, it was a popular product in the footwear market, as Muska was an especially popular figure in skateboarding culture during the late 1990s (the shoe was designed with a hidden \"stash pocket\" in the tongue of the shoe for particularly valuable items).<ref>{{cite web|title=The 50 Greatest Skate Shoes|url=http://www.complex.com/sneakers/2011/03/the-50-greatest-skate-shoes/s-muska|work=Complex Sneakers|publisher=Complex Media|accessdate=17 March 2013|author=Brian Jones|date=2|month=March|year=2011}}</ref>\n\n===Circa===\nFollowing his time with éS, Muska joined the [[C1RCA (company)|C1RCA]] footwear team in 1999 as the first pro skater for [[C1RCA (COMPANY)|C1RCA]] and released numerous signature shoe models with the brand. Models such as the \"CM901\" and \"CM902\" were promoted in magazine advertisements, and Muska also continued with the \"hidden stash pocket\" design feature that he utilized at éS.<ref>{{cite web|title=CCS - Circa CM901 Ad (1999)|url=http://skately.com/library/ads/ccs-circa-cm901-1999|work=Skately|publisher=Skately LLC|accessdate=17 March 2013|year=2013}}</ref><ref>{{cite web|title=Circa Footwear - Muska CM902 Model Ad (2000)|url=http://skately.com/library/ads/circa-footwear-muska-cm902-model-2000|work=Skately|publisher=Skately LLC|accessdate=17 March 2013|year=2013}}</ref>\n\nMuska parted ways with Circa in 2005 and he subsequently founded the Supra footwear company with Angel Cabada from One Distribution (owner of the [[KR3W]] apparel brand).\n\n===Element===\nMuska left Shorty's in early 2006 and selected [[Element Skateboards]] as his next skateboard deck sponsor in December. Following his move to Element, Muska stated \"I am very excited about joining the Element family! I look forward to this new chapter in my skateboarding career... And you can bet on it that we are going to make some big things happen.\"<ref>{{cite web|title=Welcome Back, Muska|url=http://www.tackyworld.com/skateboard/article/?id=18804|work=Tackyworld|publisher=Tacky Products AS|accessdate=17 March 2013|date=4|month=December|year=2006}}</ref> The company officially welcomed Muska with an advertisement in 2007 that featured a photograph of Muska performing a skateboard trick (frontside flip) on a street-based transitional structure—the byline for the promotion read \"Welcome To The Family\".<ref>{{cite web|title=Element Skateboards - Welcome Chad Muska Ad (2007)|url=http://skately.com/library/ads/element-skateboards-welcome-chad-muska-2007|work=Skately|publisher=Skately LLC|accessdate=17 March 2013|format=Image upload|year=2013}}</ref>\n\n===Supra===\nFounded by business partner and collaborator Angel Cabada in 2006,<ref>{{cite web|title=Supra Footwear|url=http://www.grindtv.com/brand/supra-footwear/|work=GrindTV|publisher=Yahoo! News Network and GrindMedia, LLC|accessdate=17 March 2013|year=2013}}</ref> the Supra footwear brand has been endorsed by Muska since the company's inception and Muska's first Supra signature model—the \"Skytop\"—was one of the first team rider models that was released. The first Muska Supra advertisement appeared in 2006,<ref>{{cite web|title=Supra Shoes - Chad Muska Ad (2006)|url=http://skately.com/library/ads/supra-shoes-chad-muska-2006|work=Skately|publisher=Skately LLC|accessdate=17 March 2013|year=2013}}</ref> while the inaugural official Skytop promotion appeared in 2007.<ref>{{cite web|title=Supra Shoes - Chad Muska Denim Skytop Ad (2007)|url=http://skately.com/library/ads/supra-shoes-chad-muska-denim-skytop-2007|work=Skately|publisher=Skately LLC|accessdate=17 March 2013|year=2013}}</ref> Muska has designed the signature shoe models, the Skytop, \"Skytop II\" (2009),<ref>{{cite web|title=Chad Muska Premiers the Supra Skytop II|url=http://hypebeast.com/2009/11/chad-muska-premiers-supra-skytop-ii?_locale=en|work=HypeBeast|publisher=MEDIA LAB LIMITED|accessdate=17 March 2013|date=13|month=November|year=2009}}</ref> and \"Skytop III\";<ref name=\"Sneak\">{{cite web|title=SUPRA SKYTOP III - CHAD MUSKA INTERVIEW|url=http://www.sneakerfreaker.com/articles/Skytop-Iii---Chad-Muska-Interview/|work=Sneaker Freaker|publisher=Complex Media|accessdate=17 March 2013|date=4|month=May|year=2011}}</ref> a low-cut version was also released.<ref>{{cite web|title=Supra Shoes - Chad Muska Ad (2007)|url=http://skately.com/library/ads/supra-shoes-chad-muska-2007|work=Skately|publisher=Skately LLC|accessdate=17 March 2013|year=2013}}</ref> All of the Skytop designs were created in collaboration with footwear designer Josh Brubaker and were initially perceived as outlandish by Muska's peers in the industry.<ref name=\"Sneak\" /><ref>{{cite web|title=THE BOOK OF SUPRA|url=http://xgames.espn.go.com/skateboarding/article/8770688/supra-footwear-released-book-documenting-their-rise-sneaker-valhalla|work=ESPN X Games|publisher=ESPN Internet Ventures|accessdate=17 March 2013|author=Robin Fleming|date=21|month=December|year=2012}}</ref><ref name=\"Foot\" />\n\nMuska has named a variety of influences in regard to his shoe design work, such as [[Louis Vitton]] and the [[Nike, Inc.|Nike]] \"Jordan\" range, further explaining that he has attempted to merge the aesthetics of the fashion and sneaker cultures.<ref name=\"Foot\" /> In an interview to promote the third Skytop model, Muska elaborated on his future direction:\n\n<blockquote>\nPersonally design-wise, I’m definitely all over the place and I’m thinking of so many new and exciting designs, but it’s hard for me to find places to sell a lot of the stuff, because it will be too crazy for what the shops want, especially on the skateboarding side ... I mean, the same thing happened with the Skytop I and eventually all the shops that thought it was horrible and said they would never wear it couldn’t deny the fact that people wanted this product ... I think it’s time for the world to define a new style and a new chapter and go ahead.<ref name=\"Sneak\" /></blockquote>\n\n===The Berrics===\nIn addition to introducing a new version of the [[The Berrics|Berrics]] indoor skateboard facility in early 2013,<ref>{{cite web|title=Rebirth|url=http://theberrics.com/gen-ops/rebirth.html|work=The Berrics|publisher=The Berrics|accessdate=12 December 2012|format=Video upload|date=8|month=December|year=2012}}</ref> Muska appeared on numerous occasions as a referee for the sixth installment of the [[The_Berrics#Battle_at_the_Berrics|Battle at the Berrics]] contest series, run by The Berrics website.<ref>{{cite web|title=DAVIS TORGERSON vs MORGAN SMITH|url=http://theberrics.com/battle-at-the-berrics-6/davis-torgerson-vs-morgan-smith.html|work=The Berrics|publisher=The Berrics|accessdate=16 March 2013|format=Video upload|date=3|month=February|year=2013}}</ref><ref>{{cite web|title=NICK TUCKER vs TOREY PUDWILL|url=http://theberrics.com/battle-at-the-berrics-6/nick-tucker-vs-torey-pudwill.html|work=The Berrics|publisher=The Berrics|accessdate=16 March 2013|format=Video upload|date=9|month=March|year=2013}}</ref><ref>{{cite web|title=BATB 6 Round 1 Recap|url=http://theberrics.com/battle-at-the-berrics-6/round-1-highlights.html|work=The Berrics|publisher=The Berrics|accessdate=17 March 2013|format=Video upload|date=14|month=March|year=2013}}</ref>\n\n===Sponsors===\nAs of December 2006, Muska's sponsors are Element Skateboards, [[KR3W]], Supra, Ricta, Mob Grip, and Brooklyn Projects.<ref>{{cite web|title=Chad Muska Skater Profile|url=http://skateparkoftampa.com/skater/1029/Chad_Muska|work=SPoT Skate Shop|publisher=Skatepark of Tampa|accessdate=2 September 2012|author=Skatepark of Tampa|date=1|month=December|year=2006}}</ref>\n\n===Influence===\nMuska was identified as the twelfth most influential skateboarder of all time by ''Transworld SKATEboarding'' magazine in December 2011.<ref name=\"Most\">{{cite web|title=THE 30 MOST INFLUENTIAL SKATERS OF ALL TIME|url=http://skateboarding.transworld.net/1000150173/features/the-30-most-influential-skaters-of-all-time/19/|work=Transworld SKATEboarding|publisher=Bonnier Corporation|accessdate=17 March 2013|author=Blair Alley|coauthors=Skin Phillips|date=20|month=December|year=2011}}</ref> In response to the matter of his influence on skateboarding, Muska stated in response:\n\n<blockquote>\nI’d like to think that I’ve brought something to the table. I caused a little bit of a stir at times in the industry when I think it needed it. People can talk shit about me or they love me—I don’t know what they think about me—but at least I feel I added something to the industry and I had so much fun doing it.<ref name=\"Most\" /></blockquote>\n\nProfessional skateboarder [[Tom Penny]] (identified as twenty-first on ''Transworld SKATEboarding'''s list) named Muska as one of the five skateboarders who have influenced skateboarding the most.<ref>{{cite web|title=30TH ANNIVERSARY INTERVIEWS: TOM PENNY|url=http://skateboarding.transworld.net/1000157326/features/30th-anniversary-interviews-tom-penny/|work=Transworld SKATEboarding|publisher=Bonnier Corporation|accessdate=17 March 2013|author=Blair Alley|format=Video upload|date=4|month=May|year=2012}}</ref>\n\n===Influences===\nIn addition to the influence that Muska has had on Penny, Muska revealed Penny's influence on his own skateboarding in 2012:\n\n<blockquote>\nI think what was cool is that he was pushing skateboarding in a direction that I wasn't ... and I was pushing towards bigger handrails, bigger \"hubbas\", and, kind of, unconventional skate spots. And so I think, the two of us, kind of got psyched off each other, you know? next thing I know, he was hitting, grinding bigger handrails; I started frontside flipping over handrails, you know, like? ... And just as people, I think, like, he remains-I don't have to see the guy for ten years and we'll still be best friends ... You meet people over the years that you connect with and are inspired by, you know? And I think me and Tom were definitely a major part of coming together and helping progress skateboarding at the time ...<ref name=\"Two\">{{cite web|title=30th Anniversary Interviews Chad Muska Part 2 - TransWorld SKATEboardi ...|url=http://www.youtube.com/watch?v=ujdpqDmdLg8&list=PLVLRKCBPbwgCAnusbED-eIuf3MjcVe0bO&index=1|work=YouTube|publisher=Google, Inc|accessdate=17 March 2013|author=TransworldSKATEmag|format=Video upload|date=26|month=November|year=2012}}</ref></blockquote>\n\nMuska has also identified [[Jamie Thomas]] as a major influence and described him as an individual who is readily able to identify others who are willing to work at their skateboarding diligently. Muska explained, \"I'd just watch what he was doing ... he's talking and they're listening to him, you know? So I think Jamie really opened my eyes more that you could do more than just skate and get more involved with these companies, you know?\"<ref name=\"Two\" />\n\nThe top five skateboarding influences, as identified by Muska in 2012, are [[Christian Hosoi]], Natas Kaupas, [[Mark Gonzales]], Pat Duffy, and [[Nyjah Huston]]—during the same interview, Muska admitted that \"there are so many\" and also named Kris Markovic and Jeremy Wray.<ref name=\"Two\" /> In response to the matter of who is the all-time, \"number one\" influential skateboarder in history, Muska named Gonzales, further explaining:\n\n<blockquote>\n... just still to this day. Like, I mean, just because, for me, skateboarding was never about just progression; it was about, like, the individual, and the person, and what they brought to, to skateboarding. Not many skaters could have a career as long as he has and still maintain that idea, you know? Like, still, he is skateboarding; that is, everything, is Mark—it's freedom; it's not caring about anything; it's about going on your board and enjoying yourself; pushing yourself physically, mentally, and having as much fun as you can possibly have. That's what skateboarding is and that's what Mark is.<ref name=\"Two\" /></blockquote>\n\n==Entrepreneur==\nIn 2008, Muska opened the store \"Factory413\" in [[Los Angeles]], California, US with business partner Cabada;<ref>{{cite web|title=CHAD MUSKA’S FACTORY 413 SLIDESHOW!!!|url=http://skateboarding.transworld.net/1000069157/photos/chad-muskas-factory-413-slideshow/|work=Transworld SKATEboarding|publisher=Bonnier Corporation|accessdate=17 March 2013|author=Chad Muska|coauthors=Transworld|format=Photo upload|date=9|month=January|year=2008}}</ref> The retail outlet is described on the store's website as \"a hub for avant-garde Los Angeles brands and a creative outlet for both founders.\"<ref name=\"Factory\">{{cite web|title=About|url=http://factory413.com/about/|work=Factory 413|publisher=Factory 413|accessdate=17 March 2013|year=2013}}</ref>\n\nMuska has released signature products using the \"Factory413\" name, such as sunglasses in 2010<ref>{{cite web|title=Chad Muska x Factory 413|url=http://www.empireave.com/eyewear/chad-muska-x-factory-413/|work=Empire Ave|publisher=Empire Ave|accessdate=17 March 2013|author=Lincoln Eather|date=11|month=November|year=2010}}</ref> and shoe collaboration with Supra in late 2012.<ref>{{cite web|title=FACTORY 413 Supra Skytop II \"Remix\" by Chad Muska and Steve Aoki|url=http://www.highsnobiety.com/2012/11/20/factory-413-supra-skytop-ii-remix-by-chad-muska-and-steve-aoki/|work=High Snob|publisher=Titel Media|accessdate=17 March 2013|author=Brock Cardiner|date=20|month=November|year=2012}}</ref>\n\n==Video games==\nMuska is a playable character in the [[Tony Hawk (series)|Tony Hawk]] video game series.<ref>{{cite web|title=Tony Hawk's Pro Skater 4 - Chad Muska|url=http://www.youtube.com/watch?v=VQDcW4NJXhY|work=YouTube|publisher=Google, Inc|accessdate=16 March 2013|author=TiEmKej|format=Video upload|date=24|month=September|year=2011}}</ref>\n\n==Music==\nMuska's music has been released under the alias \"Muskabeatz\" and he has produced music for old-school hip hop artists, such as [[Afrika Bambaataa]], [[Biz Markie]], [[Guru]], [[Melle Mel]], [[Ice-T]], [[Jeru the Damaja]], and [[KRS-One]], as well as [[Wu-Tang Clan]] members [[Raekwon]] and [[U-God]].<ref>{{cite web|title=Muska Beatz|url=http://www.chadmuska.org/muska-beatz|work=Beatz|publisher=Chad Muska|accessdate=2 September 2012|author=Unknown|year=Unknown}}</ref> For his debut release, Muska had planned to produce a [[Drum and bass|drum 'n' bass]] record, but he decided during the recording process that the album should have an \"old-school feel\" to it—the self-titled Muskabeatz record was released on February 13, 2003 on Muska's own 1212 Records.<ref>{{cite web|title=411 PRODUCTIONS TO RELEASE MUSKABEATZ ALBUM|url=http://skateboarding.transworld.net/1000011767/news/411-productions-to-release-muskabeatz-albums|work=Transworld Skateboarding|publisher=Bonnier Corporation|accessdate=2 September 2012|author=Transworld|date=8|month=January|year=2003}}</ref>\n\n==Visual art==\nAs of 2012, Muska continues to produce visual art (primarily painting) and has designed numerous skateboard graphics for Element. Muska also maintains a Tumblr web page that features his artwork.<ref>{{cite web|title=TheMuska|url=http://themuska.com/|work=TheMuska|publisher=Tumblr|accessdate=5 October 2012|author=Chad Muska|date=4|month=October|year=2012}}</ref>\n\n==Personal life==\nFollowing his move to Mission Beach as an adolescent, Muska was mostly homeless and spent a significant period of time sleeping on the beach; in 2012, Muska explained: \"I had nothing and those were, I can still say, by far, the happiest days of my life. Happiest beyond, craziest times, gnarliest adventures, everything, you know?\"<ref name=\"Skin\" /> As of 2012, Muska resided in [[Hollywood]], California, US.<ref name=\"Foot\" />\n\nMuska filmed a \"Footnotes\" segment for the Berrics website, in which he revealed his love of footwear, including his personal collection of footwear and models that he has designed. During the interview for the segment, Muska clarified, \"I'm not, like, that \"sneaker collector guy\" where, like, I buy one of each just to, like, save 'em and have 'em; when I like sneakers I like to get 'em and use them more, and wear 'em.\"<ref name=\"Foot\">{{cite web|title=Footnotes x Chad Muska|url=http://vimeo.com/43736179|work=defytheobvious on Vimeo|publisher=Vimeo LLC|accessdate=17 March 2013|author=defytheobvious|format=Video upload|month=May|year=2012}}</ref>\n\nOn July 14, 2011, Muska was arrested for \"[[Vandalism|felony vandalism]]\" on [[Hollywood Boulevard]], Los Angeles, California, US.<ref>{{cite web|title=Muska arrested for felony vandalism|url=http://sports.espn.go.com/action/skateboarding/news/story?id=6769773|work=ESPN|publisher=ESPN Internet Ventures|accessdate=2 September 2012|author=Adam Salo|date=14|month=July|year=2011}}</ref>\n\n== Videography ==\n*Maple: ''Rites of Passage'' (1994)\n*Etnies: ''High 5'' (1995)\n*''411VM'': ''Best Of 411, Volume 2'' (1995)\n*''411VM'': ''Issue 11'' (1995)\n*Transworld: ''Uno'' (1996)<ref>{{cite web|title=Chad Muska UNO|url=http://www.youtube.com/watch?v=8efY_EvDDUo|work=YouTube|publisher=Google, Inc|accessdate=17 March 2013|author=DJnedKnowledge422|format=Video upload|date=27|month=December|year=2010}}</ref> \n*Church of Skatan: ''Wild In The Streets'' (1998)\n*Shorty's: ''Fulfill The Dream'' (1998)<ref>{{cite web|title=Fulfill The Dream - Chad Muska|url=http://www.youtube.com/watch?v=XH9Ym4yKvA8|work=YouTube|publisher=Google, Inc|accessdate=17 March 2013|author=RyenBreskyMedia|format=Video upload|date=23|month=November|year=2011}}</ref> \n*''Genie Of The Lamp'' (1998)\n*''411VM'': ''Vancouver 1999'' (1999)\n*Transworld: ''Feedback'' (1999)\n*''Digital #3'' (2000)\n*Transworld: ''Anthology'' (2000)\n*TSA: ''Life In The Fast Lane'' (2001)\n*''Collage'' (2001)\n*Shorty's: ''Guilty'' (2001)<ref>{{cite web|title=Chad Muska - Shorty's Guilty|url=http://www.youtube.com/watch?v=tkXFViuKTCc|work=YouTube|publisher=Google, Inc|accessdate=17 March 2013|author=skatelyposse|format=Video upload|date=23|month=February|year=2012}}</ref> \n*Transworld: ''Videoradio'' (2002)\n*''411VM'': ''Good As Gold 50'' (2002)\n*''ON Video'': ''Summer 2002'' (2002)\n*Shorty's: ''T-Stance Holmes'' (2003)\n*''411VM'': ''Issue 58'' (2003)\n*The Death Squad: ''Oklahomies'' (2003)\n*''ON Video'': ''Summer 2003'' (2003)\n*Shortys: ''How To Go Pro'' (2005)\n*Strange Notes: ''Covers, Baby!'' (2007)\n*Element: ''This Is My Element'' (2007)<ref>{{cite web|title=This Is My Element - Chad Muska|url=http://www.youtube.com/watch?v=DGzjHHGXUuU|work=YouTube|publisher=Google, Inc|accessdate=17 March 2013|author=RyenBreskyMedia|format=Video upload|date=30|month=November|year=2011}}</ref> \n*''Streets: LA'' (2007)\n*Supra: ''European Tour'' (2011)<ref name=\"Vids\">{{cite web|title=Chad Muska skate videos|url=http://www.skatevideosite.com/skaters/117/chad+muska|work=Skatevideosite.com|publisher=Skatevideosite.com|accessdate=17 March 2013|year=2005–2013}}</ref>\n\nThe 1996 Toy Machine video ''Welcome To Hell'' features a bonus part from Muska that was edited to a song by Nappy Roots called \"Right Now\".<ref>{{cite web|title=Toy Machine - Welcome To Hell|url=http://www.skatevideosite.com/skatevideos/toy-machine-welcome-to-hell/soundtrack|work=Skatevideosite.com|publisher=Skatevideosite.com|accessdate=17 March 2013|year=2005–2013}}</ref><ref>{{cite web|title=Chad Muska - Toy Machine Welcome To Hell|url=http://www.youtube.com/watch?v=W_C0NpgsXgg|work=YouTube|publisher=Google, Inc|accessdate=17 March 2013|author=RyenBreskyMedia|format=Video upload|date=23|month=November|year=2011}}</ref>\n\n==References==\n{{reflist|2}}\n\n{{Persondata <!-- Metadata: see [[Wikipedia:Persondata]]. -->\n| NAME =Muska, Chad\n| ALTERNATIVE NAMES =\n| SHORT DESCRIPTION = American skateboarder\n| DATE OF BIRTH =May 20, 1977\n| PLACE OF BIRTH =[[Lorain, Ohio|Lorain]], [[Ohio]], United States\n| DATE OF DEATH =\n| PLACE OF DEATH =\n}}\n{{DEFAULTSORT:Muska, Chad}}\n[[Category:American skateboarders]]\n[[Category:People from Lorain, Ohio]]\n[[Category:1977 births]]\n[[Category:Living people]]"}]}}}}
|
|
171
314
|
end
|
|
315
|
+
|
|
316
|
+
def wikiwhat_parse_albert_thumbnail
|
|
317
|
+
{
|
|
318
|
+
"query-continue"=> {
|
|
319
|
+
"imageinfo"=> {
|
|
320
|
+
"iistart"=> "2011-01-29T12:37:30Z"
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"query"=> {
|
|
324
|
+
"normalized"=> [
|
|
325
|
+
{
|
|
326
|
+
"from"=> "File:Einstein_1921_by_F_Schmutzer.jpg",
|
|
327
|
+
"to"=> "File:Einstein 1921 by F Schmutzer.jpg"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"pages"=> {
|
|
331
|
+
"-1"=> {
|
|
332
|
+
"ns"=> 6,
|
|
333
|
+
"title"=> "File:Einstein 1921 by F Schmutzer.jpg",
|
|
334
|
+
"missing"=> "",
|
|
335
|
+
"imagerepository"=> "shared",
|
|
336
|
+
"imageinfo"=> [
|
|
337
|
+
{
|
|
338
|
+
"thumburl"=> "http://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Einstein_1921_by_F_Schmutzer.jpg/152px-Einstein_1921_by_F_Schmutzer.jpg",
|
|
339
|
+
"thumbwidth"=> 152,
|
|
340
|
+
"thumbheight"=> 200,
|
|
341
|
+
"url"=> "http://upload.wikimedia.org/wikipedia/commons/6/66/Einstein_1921_by_F_Schmutzer.jpg",
|
|
342
|
+
"descriptionurl"=> "http://commons.wikimedia.org/wiki/File:Einstein_1921_by_F_Schmutzer.jpg"
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
def wikiwhat_parse_albert_thumbnail_url
|
|
352
|
+
"http://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Einstein_1921_by_F_Schmutzer.jpg/152px-Einstein_1921_by_F_Schmutzer.jpg"
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
def apispec_img_thumbnail
|
|
356
|
+
{"query-continue"=>
|
|
357
|
+
{ "imageinfo"=>
|
|
358
|
+
{"iistart"=>"2009-12-05T02:28:03Z"}},
|
|
359
|
+
"query"=>
|
|
360
|
+
{"pages"=>
|
|
361
|
+
{"-1"=>
|
|
362
|
+
{"ns"=>6,
|
|
363
|
+
"title"=>"File:Kelmitchellpic.jpg",
|
|
364
|
+
"missing"=>"",
|
|
365
|
+
"imagerepository"=>"shared",
|
|
366
|
+
"imageinfo"=>[
|
|
367
|
+
{"thumburl"=>"http://upload.wikimedia.org/wikipedia/commons/c/c4/Kelmitchellpic.jpg",
|
|
368
|
+
"thumbwidth"=>154,
|
|
369
|
+
"thumbheight"=>314,
|
|
370
|
+
"url"=>"http://upload.wikimedia.org/wikipedia/commons/c/c4/Kelmitchellpic.jpg",
|
|
371
|
+
"descriptionurl"=>"http://commons.wikimedia.org/wiki/File:Kelmitchellpic.jpg"}]}}}}
|
|
372
|
+
end
|
metadata
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wikiwhat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bonnie Mattson, Clare Glinka
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-06-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '0'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rest-client
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: bundler
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - ~>
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '1.3'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - ~>
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '1.3'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rake
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: vcr
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- -
|
|
73
|
+
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '0'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- -
|
|
80
|
+
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: webmock
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- - ~>
|
|
87
|
+
- - "~>"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: 1.8.0
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- - ~>
|
|
94
|
+
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: 1.8.0
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: rspec
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- -
|
|
101
|
+
- - ">="
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
103
|
version: '0'
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- -
|
|
108
|
+
- - ">="
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
description: Gem for extracting specific content from Wikipedia articles.
|
|
@@ -115,8 +115,8 @@ executables: []
|
|
|
115
115
|
extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
|
117
117
|
files:
|
|
118
|
-
- .gitignore
|
|
119
|
-
- .rspec
|
|
118
|
+
- ".gitignore"
|
|
119
|
+
- ".rspec"
|
|
120
120
|
- Gemfile
|
|
121
121
|
- LICENSE.txt
|
|
122
122
|
- README.md
|
|
@@ -129,6 +129,7 @@ files:
|
|
|
129
129
|
- lib/wikiwhat/wikierror.rb
|
|
130
130
|
- spec/api_call_spec.rb
|
|
131
131
|
- spec/fixtures/vcr_cassettes/albert.yml
|
|
132
|
+
- spec/fixtures/vcr_cassettes/image_thumbnail.yml
|
|
132
133
|
- spec/fixtures/vcr_cassettes/image_url.yml
|
|
133
134
|
- spec/fixtures/vcr_cassettes/kel_extract.yml
|
|
134
135
|
- spec/fixtures/vcr_cassettes/kel_revisions.yml
|
|
@@ -149,23 +150,24 @@ require_paths:
|
|
|
149
150
|
- lib
|
|
150
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
152
|
requirements:
|
|
152
|
-
- -
|
|
153
|
+
- - ">="
|
|
153
154
|
- !ruby/object:Gem::Version
|
|
154
155
|
version: '0'
|
|
155
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
157
|
requirements:
|
|
157
|
-
- -
|
|
158
|
+
- - ">="
|
|
158
159
|
- !ruby/object:Gem::Version
|
|
159
160
|
version: '0'
|
|
160
161
|
requirements: []
|
|
161
162
|
rubyforge_project:
|
|
162
|
-
rubygems_version: 2.
|
|
163
|
+
rubygems_version: 2.2.2
|
|
163
164
|
signing_key:
|
|
164
165
|
specification_version: 4
|
|
165
166
|
summary: ''
|
|
166
167
|
test_files:
|
|
167
168
|
- spec/api_call_spec.rb
|
|
168
169
|
- spec/fixtures/vcr_cassettes/albert.yml
|
|
170
|
+
- spec/fixtures/vcr_cassettes/image_thumbnail.yml
|
|
169
171
|
- spec/fixtures/vcr_cassettes/image_url.yml
|
|
170
172
|
- spec/fixtures/vcr_cassettes/kel_extract.yml
|
|
171
173
|
- spec/fixtures/vcr_cassettes/kel_revisions.yml
|