metonym 0.1.0 → 0.1.1
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 +33 -0
- data/lib/metonym/version.rb +1 -1
- data/lib/metonym.rb +0 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e81e54efd95bea0fd9fb3d0d60bd8ed7f9aa47446940fba655727deaf2fa540e
|
4
|
+
data.tar.gz: 0c8a8841e0bced4cad65b8f1c4a2916fd7d664d2aaafe2ecddcc67280f93bf4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d738e6519d6c63e0b63cbbb5e5b4b8ed89fdd583f216ec28c21b32fbe90f7980827b68046b267ac61740ee49877e07ea4af1ccc57a03a07a04818921aa124c2
|
7
|
+
data.tar.gz: 5cf2e7658dbca5e7d62f336f4cc084828e258dd82321d28547998a3b7ad2cfb5bbb078af673c930dfff35e1a1c1647202e66f65e12eb2eec65965147127a9185
|
data/README.md
CHANGED
@@ -53,6 +53,39 @@ puts response
|
|
53
53
|
}
|
54
54
|
]
|
55
55
|
}
|
56
|
+
```
|
57
|
+
|
58
|
+
You can also send a second parmeter to the search method to indicate that the response be parsed to a ruby hash for easier manipulation. By default, the request will respond with a JSON.
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
# Establish parameters for query
|
62
|
+
args = { "q" => "Game of Thrones", "country" => "DE", 'max' => 1 }
|
63
|
+
|
64
|
+
# Send Request with HASH response property
|
65
|
+
gnews = Gnews::Query.new('my-secret-key', 'hash')
|
66
|
+
response = gnews.search(args)
|
67
|
+
|
68
|
+
puts response
|
69
|
+
# =>
|
70
|
+
|
71
|
+
{
|
72
|
+
"timestamp"=>1558094332,
|
73
|
+
"count_results"=>1,
|
74
|
+
"articles"=>[
|
75
|
+
{
|
76
|
+
"title"=>"'Game of Thrones' finale: How will it end? Here are a few theories",
|
77
|
+
"desc"=>"", "link"=>"https://www.goodmorningamerica.com/culture/story/game-thrones-finale-popular-theories-end-63057785",
|
78
|
+
"website"=>"https://www.goodmorningamerica.com",
|
79
|
+
"source"=>"GMA",
|
80
|
+
"date"=>"Fri, 17 May 2019 08:06:11 GMT",
|
81
|
+
"image"=>"https://lh4.googleusercontent.com/proxy/KI8XVNS35Y9hvR55LjjCwpjB4zTUcQxQb5N3H41bc4JRvdcz5qZCIDG2bFHyO6WxqhdVQ5qc5TxPsoqaObiZsY9sqjZRvrsQ7qEdLewSS272opiVWH5S
|
82
|
+
MydvTAug0D-dSSDfZDG9oywTEcfQXsWXtzBHULFJzLYwJDjmnxza=-c"
|
83
|
+
}
|
84
|
+
]
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
|
56
89
|
```
|
57
90
|
|
58
91
|
## Search Parameters
|
data/lib/metonym/version.rb
CHANGED
data/lib/metonym.rb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
require "metonym/version"
|
2
|
-
<<<<<<< HEAD
|
3
|
-
=======
|
4
2
|
require 'date'
|
5
3
|
require 'net/http'
|
6
4
|
require 'metonym/lib/gnews.rb'
|
7
5
|
require 'metonym/lib/validate.rb'
|
8
6
|
require 'byebug'
|
9
7
|
require 'json'
|
10
|
-
>>>>>>> develop
|
11
8
|
|
12
9
|
module Metonym
|
13
10
|
class Error < StandardError; end
|