nyt_search 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -6
- data/lib/nyt_search/search.rb +1 -1
- data/lib/nyt_search/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4ffb4d304aa573af6de16ba43e68692bd2dba06
|
4
|
+
data.tar.gz: 9e1199032697a8c3a7497041618130fb3dda1008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5903d81e4c3f82788263bdf009b58a7aebca53a6859156ec6ea2e1959c750d1b7669531073b378ed3f2189b6b27fc2d3ac1447f8b5e71ec069e8caf7fb6fbf7d
|
7
|
+
data.tar.gz: 44154c40bf641795cf89a27ddb5df4ebe6a2b2c85707fe50b7a4c5ea3631a6bcd190982aece97a199a88d39fbf09961fca37a037a81ac83b001bec8e48c81f91
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ Get your API key [here](http://developer.nytimes.com/apps/mykeys).
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'nyt_search'
|
12
|
+
gem 'nyt_search', :git => 'https://github.com/Frylock13/nyt_search.git'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -24,9 +24,7 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
`NytSearch::Api.key("your_api_key")`
|
26
26
|
|
27
|
-
If rails in *config/environments/*
|
28
|
-
|
29
|
-
`NytSearch::Api.key("your_api_key")`
|
27
|
+
If rails, set it in *config/environments/*
|
30
28
|
|
31
29
|
## Usage
|
32
30
|
|
@@ -34,11 +32,19 @@ If rails in *config/environments/*
|
|
34
32
|
@search = NytSearch::Article.search(query: "obama", sort: "newest", page: 2)['response']['docs']
|
35
33
|
```
|
36
34
|
|
37
|
-
Available options:
|
35
|
+
Available options: [
|
36
|
+
```
|
37
|
+
query,
|
38
|
+
sort(newest, oldest),
|
39
|
+
page,
|
40
|
+
begin_date(YYYYMMDD),
|
41
|
+
end_date(YYYYMMDD)
|
42
|
+
```
|
43
|
+
]
|
38
44
|
|
39
45
|
## Contributing
|
40
46
|
|
41
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
47
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Frylock13/nyt_search. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
42
48
|
|
43
49
|
|
44
50
|
## License
|
data/lib/nyt_search/search.rb
CHANGED
@@ -6,7 +6,7 @@ module NytSearch
|
|
6
6
|
url += "&sort=#{options[:sort]}" if options[:sort]
|
7
7
|
url += "&begin_date=#{options[:begin_date]}" if options[:begin_date]
|
8
8
|
url += "&end_date=#{options[:end_date]}" if options[:end_date]
|
9
|
-
NytSearch::Api.get_json(url)
|
9
|
+
NytSearch::Api.get_json(url)['response']['docs']
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/nyt_search/version.rb
CHANGED