omniauth-readability 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/Readme.md +17 -0
- data/lib/omniauth-readability.rb +2 -0
- data/lib/omniauth-readability/version.rb +5 -0
- data/lib/omniauth/strategies/readability.rb +24 -0
- data/omniauth-readability.gemspec +24 -0
- metadata +87 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/Readme.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
### An omniauth strategy for [Readability](www.readability.com)
|
2
|
+
#### config/initializers/omniauth.rb
|
3
|
+
``` ruby
|
4
|
+
|
5
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
6
|
+
provider :readability,'your_client_id','your_client_secret'
|
7
|
+
end
|
8
|
+
|
9
|
+
```
|
10
|
+
|
11
|
+
#### Rails3.1 Gemfile
|
12
|
+
``` ruby
|
13
|
+
|
14
|
+
gem 'omniauth'
|
15
|
+
gem 'omniauth-readability'
|
16
|
+
|
17
|
+
```
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'omniauth-oauth'
|
2
|
+
require 'multi_json'
|
3
|
+
|
4
|
+
module OmniAuth
|
5
|
+
module Strategies
|
6
|
+
class Readability < OmniAuth::Strategies::OAuth
|
7
|
+
|
8
|
+
option :client_options, {
|
9
|
+
:site => 'https://www.readability.com',
|
10
|
+
:request_token_path => '/api/rest/v1/oauth/request_token/',
|
11
|
+
:authorize_path => '/api/rest/v1/oauth/authorize/',
|
12
|
+
:access_token_path => '/api/rest/v1/oauth/access_token/'
|
13
|
+
}
|
14
|
+
|
15
|
+
uid { user_info['username'] }
|
16
|
+
|
17
|
+
private
|
18
|
+
def user_info
|
19
|
+
MultiJson.decode(access_token.get('https://www.readability.com/api/rest/v1/users/_current').body)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/omniauth-readability/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["dongbin.li"]
|
6
|
+
gem.email = ["mike.d.1984@gmail.com"]
|
7
|
+
gem.description = %q{readability omniauth strategy}
|
8
|
+
gem.summary = %q{readability omniauth strategy}
|
9
|
+
gem.homepage = "https://github.com/29decibel/omniauth-readability"
|
10
|
+
|
11
|
+
gem.rubyforge_project = "omniauth-readability"
|
12
|
+
gem.add_dependency 'omniauth', '~> 1.0.0.rc2'
|
13
|
+
gem.add_dependency 'omniauth-oauth', '~> 1.0.0.rc2'
|
14
|
+
gem.add_dependency 'multi_json'
|
15
|
+
|
16
|
+
|
17
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
gem.files = `git ls-files`.split("\n")
|
19
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
gem.name = "omniauth-readability"
|
21
|
+
gem.require_paths = ["lib"]
|
22
|
+
gem.version = Omniauth::Readability::VERSION
|
23
|
+
end
|
24
|
+
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-readability
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- dongbin.li
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-18 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: omniauth
|
16
|
+
requirement: &2164708880 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.0.0.rc2
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2164708880
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: omniauth-oauth
|
27
|
+
requirement: &2164708380 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.0.0.rc2
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2164708380
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: multi_json
|
38
|
+
requirement: &2164708000 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *2164708000
|
47
|
+
description: readability omniauth strategy
|
48
|
+
email:
|
49
|
+
- mike.d.1984@gmail.com
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .gitignore
|
55
|
+
- Gemfile
|
56
|
+
- Rakefile
|
57
|
+
- Readme.md
|
58
|
+
- lib/omniauth-readability.rb
|
59
|
+
- lib/omniauth-readability/version.rb
|
60
|
+
- lib/omniauth/strategies/readability.rb
|
61
|
+
- omniauth-readability.gemspec
|
62
|
+
homepage: https://github.com/29decibel/omniauth-readability
|
63
|
+
licenses: []
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project: omniauth-readability
|
82
|
+
rubygems_version: 1.8.11
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: readability omniauth strategy
|
86
|
+
test_files: []
|
87
|
+
has_rdoc:
|