pixabay-api 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 756b9e918afdf2e0d92fce49c35ed0fd1772bfa0
4
- data.tar.gz: 47bb6c191b31c3c6c712f388831d77c10413002a
3
+ metadata.gz: f96db1663965c645ddcc87f1508db059f0f4e1e2
4
+ data.tar.gz: 7c6cdae2b38dc404abf0e7bd2c96560c994de05d
5
5
  SHA512:
6
- metadata.gz: 29488016d3dc3a6eca5d759926924df21774d54daeae782129673393fbd03df6bb16b35dbbf4041561500841bd6a47893ca7850e4d832829ba31d37c7841b4c0
7
- data.tar.gz: fbb75b74829829fb46f0226f3146fd21323630d015e508d167d0008ec62623888a24287846ac6aa83a0a2b1b17fcd30cc86b6d838e154ea8f696f38296e52d12
6
+ metadata.gz: 3265121f3bb56598cffff5f7e773115bebb45b09533cc4e222a559eb1999e838b2979e86cd79c9c8509afce96bc86cc3f99ea94207868565ab0270147256fd90
7
+ data.tar.gz: 330c8e0f0dae04d9944551aaf99245d932456b080fc77b4035f22343117d69732b083c8fac2164686f442ba6612a71df7de5708ea47fdba77d75b23201ecde52
data/README.md CHANGED
@@ -9,7 +9,7 @@ A Ruby API for [https://pixabay.com](https://pixabay.com)
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'pixabay'
12
+ gem 'pixabay-api', require: 'pixabay'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -18,7 +18,7 @@ And then execute:
18
18
 
19
19
  Or install it yourself as:
20
20
 
21
- $ gem install pixabay
21
+ $ gem install pixabay-api
22
22
 
23
23
  ## Usage
24
24
 
@@ -43,7 +43,8 @@ client.photos(lang: 'ko', safesearch: true, page: 1, per_page: 30)
43
43
  Avalable Request parameters, see [https://pixabay.com/api/docs/](https://pixabay.com/api/docs/)
44
44
 
45
45
  ```ruby
46
- options = {
46
+ # Default Request parameters
47
+ {
47
48
  response_group: 'image_details', id: nil, q: nil, lang: 'en',
48
49
  image_type: 'all', orientation: 'all', category: nil, min_width: 0,
49
50
  min_height: 0, editors_choice: false, safesearch: false,
@@ -51,6 +52,38 @@ options = {
51
52
  }
52
53
  ```
53
54
 
55
+ Example responses
56
+
57
+ ```ruby
58
+ [
59
+ {
60
+ "previewHeight"=>150,
61
+ "likes"=>7,
62
+ "favorites"=>7,
63
+ "tags"=>"사람, 사람의, 여성",
64
+ "webformatHeight"=>640,
65
+ "views"=>107,
66
+ "webformatWidth"=>427,
67
+ "previewWidth"=>100,
68
+ "comments"=>2,
69
+ "downloads"=>37,
70
+ "pageURL"=>"https://pixabay.com/ko/%EC%82%AC%EB%9E%8C-%EC%82%AC%EB%9E%8C%EC%9D%98-%EC%97%AC%EC%84%B1-%EC%86%8C%EB%85%80-1166368/",
71
+ "previewURL"=>"https://pixabay.com/static/uploads/photo/2016/01/28/14/59/person-1166368_150.jpg",
72
+ "webformatURL"=>"https://pixabay.com/get/e834b7092bf2093ed95c4518b74d419fe170e4d104b0154491f3c17caeedb7_640.jpg",
73
+ "imageWidth"=>2667,
74
+ "user_id"=>526143,
75
+ "user"=>"Pezibear",
76
+ "type"=>"photo",
77
+ "id"=>1166368,
78
+ "userImageURL"=>"https://pixabay.com/static/uploads/user/2015/01/09/23-10-25-395_250x250.jpg",
79
+ "imageHeight"=>4000
80
+ },
81
+ {
82
+ ...
83
+ }
84
+ ]
85
+ ```
86
+
54
87
  ## Development
55
88
 
56
89
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -59,10 +92,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
59
92
 
60
93
  ## Contributing
61
94
 
62
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pixabay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
95
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kimsuelim/pixabay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
63
96
 
64
97
 
65
98
  ## License
66
99
 
67
100
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
68
-
@@ -30,12 +30,11 @@ module Pixabay
30
30
  def photos(**options)
31
31
  options = {
32
32
  query: {
33
- key: @api_key,
33
+ key: @api_key
34
34
  }.merge(options)
35
35
  }
36
36
 
37
- body = self.class.get('', options)
38
- body['hits']
37
+ self.class.get('', options)
39
38
  end
40
39
  end
41
40
  end
@@ -1,3 +1,3 @@
1
1
  module Pixabay
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{A ruby wrapper for the pixabay API}
13
13
  spec.description = %q{A ruby wrapper for the pixabay API}
14
- spec.homepage = "http://github.com/kimsuelim/Pixabay"
14
+ spec.homepage = "https://github.com/kimsuelim/pixabay"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixabay-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Surim Kim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-14 00:00:00.000000000 Z
11
+ date: 2016-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -100,7 +100,7 @@ files:
100
100
  - lib/pixabay/config.rb
101
101
  - lib/pixabay/version.rb
102
102
  - pixabay.gemspec
103
- homepage: http://github.com/kimsuelim/Pixabay
103
+ homepage: https://github.com/kimsuelim/pixabay
104
104
  licenses:
105
105
  - MIT
106
106
  metadata: {}