wikipedia_rest_client 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -5
- data/lib/wikipedia_rest_client/page.rb +6 -6
- data/lib/wikipedia_rest_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3327c3fd0e1d32012710af82c19bc2c321cee2fe7f97eafb097733c869faacf4
|
4
|
+
data.tar.gz: 9c09fdc3ea5fd6eb4ad86acd20f5269ed0afcdcfa755e2712037d589c0fbf1af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2e4f1e96ac0cbe367c27ec9d9d9759b229fb1598c57791c43df8b0cde5f14dd5415c429fcc02f589642d36f8c2bb1a2850211a3ccf0433f4a747e3bedcd0d9b
|
7
|
+
data.tar.gz: 8e7869345f82bfdc090d4347e32a2714449e74a237ea7dadb400f4234adefbe84a16f80036351b43d6bfea30b5480eb95e1c5db6181daa2719ea89652744016a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -185,7 +185,7 @@ picture_of_the_day_for_a_date = WikipediaRestClient.get_image_of_the_day("2017/0
|
|
185
185
|
picture_of_the_day_for_a_date.image_url
|
186
186
|
#=> "https://upload.wikimedia.org/wikipedia/commons/4/4b/Cyclosia_papilionaris-Kadavoor-2016-06-17-001.jpg"
|
187
187
|
picture_of_the_day_for_a_date.description_text
|
188
|
-
#=> "
|
188
|
+
#=> "Cyclosia papilionaris, Drury's Jewel, is a moth in the Zygaenidae family. There are many subspecies and this is Cyclosia papilionaris australinda found in South India."
|
189
189
|
```
|
190
190
|
|
191
191
|
It will have the following information,
|
@@ -228,9 +228,9 @@ on_that_day[0]["text"]
|
|
228
228
|
### Get News
|
229
229
|
|
230
230
|
```ruby
|
231
|
-
|
231
|
+
news = WikipediaRestClient.get_news
|
232
232
|
#=> Returns 'news' contents of the current date
|
233
|
-
|
233
|
+
news_on_specified_date = WikipediaRestClient.get_news(<DATE>) #Date Should be in YYYY/MM/DD Format
|
234
234
|
#=> Returns 'news' contents of the specified date
|
235
235
|
```
|
236
236
|
|
@@ -247,9 +247,9 @@ news[0]["links"]
|
|
247
247
|
### Most-Read articles of the day
|
248
248
|
|
249
249
|
```ruby
|
250
|
-
|
250
|
+
most_read_content = WikipediaRestClient.get_most_read
|
251
251
|
#=> Returns 'most read' contents of the current date
|
252
|
-
|
252
|
+
most_read_on_specified_day = WikipediaRestClient.get_most_read(<DATE>) #Date Should be in YYYY/MM/DD Format
|
253
253
|
#=> Returns 'most read' contents of the specified date
|
254
254
|
```
|
255
255
|
|
@@ -55,17 +55,17 @@ module WikipediaRestClient
|
|
55
55
|
|
56
56
|
# Returns the source of the thumbnail image
|
57
57
|
def thumbnail_source
|
58
|
-
@data["thumbnail"]["source"]
|
58
|
+
@data["thumbnail"]["source"] if @data["thumbnail"]
|
59
59
|
end
|
60
60
|
|
61
61
|
# Returns the width of the thumbnail image
|
62
62
|
def thumbnail_width
|
63
|
-
@data["thumbnail"]["width"]
|
63
|
+
@data["thumbnail"]["width"] if @data["thumbnail"]
|
64
64
|
end
|
65
65
|
|
66
66
|
# Returns the height of the thumbnail image
|
67
67
|
def thumbnail_height
|
68
|
-
@data["thumbnail"]["height"]
|
68
|
+
@data["thumbnail"]["height"] if @data["thumbnail"]
|
69
69
|
end
|
70
70
|
|
71
71
|
# Returns the language of that page
|
@@ -100,17 +100,17 @@ module WikipediaRestClient
|
|
100
100
|
|
101
101
|
# Returns the url of the main image in the page
|
102
102
|
def image_url
|
103
|
-
@data["originalimage"]["source"]
|
103
|
+
@data["originalimage"]["source"] if @data["originalimage"]
|
104
104
|
end
|
105
105
|
|
106
106
|
# Returns width of the main image it the page
|
107
107
|
def image_width
|
108
|
-
@data["originalimage"]["width"]
|
108
|
+
@data["originalimage"]["width"] if @data["originalimage"]
|
109
109
|
end
|
110
110
|
|
111
111
|
# Returns height of the main image it the page
|
112
112
|
def image_height
|
113
|
-
@data["originalimage"]["height"]
|
113
|
+
@data["originalimage"]["height"] if @data["originalimage"]
|
114
114
|
end
|
115
115
|
|
116
116
|
# Returns page url (desktop)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikipedia_rest_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Balaji
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|