unsplash 1.0.0.pre.rc.1 → 1.0.0.pre.rc.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 +8 -2
- data/lib/unsplash.rb +1 -0
- data/lib/unsplash/stats.rb +15 -0
- data/lib/unsplash/version.rb +1 -1
- data/unsplash.gemspec +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb97d4e989ae2ba8e5b0f85b79b3ce1378541132
|
4
|
+
data.tar.gz: f8b0938a390e40d75ad10c357bc13dbd4e5418ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffd3c656ff307cc866fdf5e82b14d264c2ca1f2e6a511bc6c79e9f77033769576c70c099cc1335edcba1208d060c82fd5ca6a1f8db3ed9b40a7a02d38bfb6b91
|
7
|
+
data.tar.gz: f648a40cc0e442c2dbf1c25521766bbb4eeb9ee35e2c555c2f788e13f07abce213ec496a78d2784d1d5325f606e1333e544a6b5e3d65576e7b3bb4c8358e6cce
|
data/README.md
CHANGED
@@ -52,11 +52,11 @@ Want a bunch of pictures of cats? You're on the internet; of course you do.
|
|
52
52
|
search_results = Unsplash::Photo.search("cats")
|
53
53
|
```
|
54
54
|
|
55
|
-
For a complete list of available actions, see our [documentation details]().
|
55
|
+
For a complete list of available actions, see our [documentation details](http://www.rubydoc.info/github/CrewLabs/unsplash_rb).
|
56
56
|
|
57
57
|
### User Authorization
|
58
58
|
|
59
|
-
For non-public actions, you'll have to get
|
59
|
+
For non-public actions, you'll have to get the user's permission to access their data.
|
60
60
|
Direct them to the Unsplash authorization URL:
|
61
61
|
|
62
62
|
```ruby
|
@@ -74,6 +74,12 @@ Unsplash::Client.connection.authorize!("the authentication code")
|
|
74
74
|
And that's it. The API actions will be available to you according to whichever
|
75
75
|
permission scopes you requested and the user authorized.
|
76
76
|
|
77
|
+
### Hotlinking
|
78
|
+
|
79
|
+
Hotlinking the Unsplash image files is encouraged: https://unsplash.com/documentation#hotlinking
|
80
|
+
|
81
|
+
Unlike most APIs, Unsplash prefers for the image URLs returned by the API to be directly used or embedded in your applications (generally referred to as hotlinking). By using the CDN and embedding the photo URLs in your application, Unsplash can better track photo views and pass those stats on to the photographer, providing them with context for how popular their photo is and how it's being used.
|
82
|
+
|
77
83
|
## Development
|
78
84
|
|
79
85
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/unsplash.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Unsplash # :nodoc:
|
2
|
+
|
3
|
+
# Retrieve Unsplash stats
|
4
|
+
class Stats < Client
|
5
|
+
|
6
|
+
class << self
|
7
|
+
# Get a list of statistics regardling Unsplash as a whole.
|
8
|
+
# @return [Hash] The numbers.
|
9
|
+
def total
|
10
|
+
JSON.parse(connection.get("/stats/total").body)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/lib/unsplash/version.rb
CHANGED
data/unsplash.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.required_ruby_version = ">= 2.0.0"
|
22
|
+
|
21
23
|
spec.add_dependency "httparty", "~> 0.13.5"
|
22
24
|
spec.add_dependency "oauth2", "~> 1.0.0"
|
23
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unsplash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.rc.
|
4
|
+
version: 1.0.0.pre.rc.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Klaassen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/unsplash/curated_batch.rb
|
136
136
|
- lib/unsplash/errors.rb
|
137
137
|
- lib/unsplash/photo.rb
|
138
|
+
- lib/unsplash/stats.rb
|
138
139
|
- lib/unsplash/user.rb
|
139
140
|
- lib/unsplash/version.rb
|
140
141
|
- unsplash.gemspec
|
@@ -150,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
150
151
|
requirements:
|
151
152
|
- - ">="
|
152
153
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
154
|
+
version: 2.0.0
|
154
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
156
|
requirements:
|
156
157
|
- - ">"
|