image_searcher 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/README.md +6 -7
- data/lib/image_searcher/search.rb +2 -1
- data/lib/image_searcher/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: dc7c58b27c0f5d1216a260d972f7cfd8e3f95157
|
4
|
+
data.tar.gz: 13c260375760eacd5f260ae386ceb33e39a8dacb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5497499a507122c0a4d049fc7abece9543f3b6379091584f0923459b8b03d2d00e9b04fd1ce078bb420e05841dc759f21dc154e1dc7d2d13043a3656ba52bc3d
|
7
|
+
data.tar.gz: 786ea529764fff72223e6444c6b2c0cfb80e3b5fba33f29682a8d5511c9e848941e09223283a524d6465ea55efa737d35462d1d3f5b78333eabf54db646f1a70
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# Image Searcher
|
2
2
|
|
3
|
-
A ruby wrapper for the [Ababeen](http://api.ababeen.com)
|
3
|
+
A ruby wrapper for the [Ababeen](http://api.ababeen.com) Image Search API v1.0 - a modest analogue of deprecated Google Image Search API.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem '
|
10
|
+
gem 'image_searcher', '~> 0.1.1'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -24,16 +24,15 @@ Or install it yourself as:
|
|
24
24
|
@result = ImageSearcher.search(query: "New York")
|
25
25
|
```
|
26
26
|
|
27
|
-
And you'll have a nested array with results. By default the
|
27
|
+
And you'll have a nested array with results. By default the result has `10` images.
|
28
28
|
|
29
29
|
**Available options**:
|
30
30
|
```
|
31
31
|
query(String)
|
32
|
-
count(Integer) - maximum 100
|
33
|
-
preview(Boolean) - false by default
|
34
|
-
|
35
|
-
For example: `http://api.ababeen.com/api/images.php?q=America&preview=true&count=100`
|
32
|
+
count(Integer) - maximum 100(10 by default)
|
33
|
+
preview(Boolean) - show all images in preview(false by default)
|
36
34
|
```
|
35
|
+
For example: `ImageSearcher.search(query: "New York", count: 66, preview: true)`
|
37
36
|
|
38
37
|
## Contributing
|
39
38
|
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module ImageSearcher
|
2
2
|
def self.search(options = {})
|
3
|
-
|
3
|
+
raise "Missing query" unless options[:query]
|
4
4
|
|
5
|
+
base_uri = ImageSearcher::API::BASE_URI
|
5
6
|
url = "#{base_uri}?q=#{options[:query]}"
|
6
7
|
url += "&count=#{options[:count]}" if options[:count]
|
7
8
|
url += "&page=#{options[:preview]}" if options[:preview]
|