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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d24a2ecbb2f9cfe1a6de6ae707118cc13d35abd1
4
- data.tar.gz: 172c51085f995118ffc15a92c2ef17284593c675
3
+ metadata.gz: fb97d4e989ae2ba8e5b0f85b79b3ce1378541132
4
+ data.tar.gz: f8b0938a390e40d75ad10c357bc13dbd4e5418ad
5
5
  SHA512:
6
- metadata.gz: 45f1db807acc4fa2a60de1f2ea68336ccf46007287efd891ad021be0bda1e78bf1ff7824d38532ed10e8b67635766d23f0f80482f2e4c1e51ed7d971c06f03b8
7
- data.tar.gz: 73bb7c914802ab64a1530ab03385e6c718469677fe4e196f75177875d2eda8d273069cd8564f5173a2fd1a1b1a4a1e9497b781671c54f4b1f0d8a48129908525
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 your user's permission to access their data.
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
@@ -10,6 +10,7 @@ require "unsplash/user"
10
10
  require "unsplash/photo"
11
11
  require "unsplash/category"
12
12
  require "unsplash/curated_batch"
13
+ require "unsplash/stats"
13
14
 
14
15
  module Unsplash
15
16
  class << self
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Unsplash # :nodoc:
2
2
  # :nodoc:
3
- VERSION = "1.0.0.pre.rc.1"
3
+ VERSION = "1.0.0.pre.rc.2"
4
4
  end
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.1
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-07-13 00:00:00.000000000 Z
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: '0'
154
+ version: 2.0.0
154
155
  required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  requirements:
156
157
  - - ">"