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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '089f42b8eb9bbf9ef3d2e7fdc1cff03acdd8d2e8fad4d4413ab08f407ad568b3'
4
- data.tar.gz: ad1d43a4d2e1f81ab1495aca8c587807d76c406c6a336c9ee1b7cbda4f019e9c
3
+ metadata.gz: e81e54efd95bea0fd9fb3d0d60bd8ed7f9aa47446940fba655727deaf2fa540e
4
+ data.tar.gz: 0c8a8841e0bced4cad65b8f1c4a2916fd7d664d2aaafe2ecddcc67280f93bf4b
5
5
  SHA512:
6
- metadata.gz: 9208560a7675b7ff77b931775f6db7abe98b009d5e3a358053b8024e8818146283260ad135386b5435fe84d3c6296da4c0307ead7e5bf7f2e1ceee5696c5b513
7
- data.tar.gz: 9609696131912296dde9e41d02db5bb3e4097417c1337b819d590d56345618ee0a6d00a6e10c1a61b0a423eec601c3dcef11e7106a67fa4d0d8771fce17963fc
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
@@ -1,3 +1,3 @@
1
1
  module Metonym
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metonym
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vic Carrasco