oauth_twitter 0.0.2 → 0.1.0
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.
- checksums.yaml +8 -8
- data/lib/oauth_twitter/helper.rb +8 -4
- data/lib/oauth_twitter/version.rb +1 -1
- data/oauth_twitter.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGI3NTNmYzZhNzNmYzVkMTQ4YjdkNTgyYTgyMTFhOTM4MDNkODQ1Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzBmMzgyNjk1MWJmNzFmNGUxMGExYjk3NDlkMDNhYzYyNTlmNjkzNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmU0NTcxNzg5OTliOWFlYzVlODFkOWZkNmRjYzg1M2M2NjhlNmY5YzIyOTE5
|
10
|
+
YzIwOGQ1MGM2MDVkNzRhNjUwZDIxZmQ3Y2M0MWQ0MjU1N2ZhNGMwMTU2NDk2
|
11
|
+
YzVmOWQ2MjVkZTlmMTJlZjY2M2NlYmIyYjgyNjRjZWE1YmUwZjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmZhZDM2YjYyOTE1ODRlNDI5ZmMyMGExMjYwNDEwZjc2YzY0ZmIyNDlhMGNm
|
14
|
+
MzM4NGUzZmQxMzY1NjBjZGQzYmM1ZTQzNTM0MjBmMzYyNjJhMjA3YTYxNTYz
|
15
|
+
YWEwZmI3MzJiMDgwYmRjZjYwYjZlYzA3OTgyNTE5MzM0Mzg4M2I=
|
data/lib/oauth_twitter/helper.rb
CHANGED
@@ -3,7 +3,7 @@ require "openssl"
|
|
3
3
|
require "base64"
|
4
4
|
require "uri"
|
5
5
|
require "net/http"
|
6
|
-
require "
|
6
|
+
require "multi_json"
|
7
7
|
|
8
8
|
module OauthTwitter
|
9
9
|
module Helper
|
@@ -53,12 +53,16 @@ module OauthTwitter
|
|
53
53
|
end
|
54
54
|
request["Authorization"] = auth_header
|
55
55
|
# Response
|
56
|
-
|
56
|
+
begin
|
57
|
+
response = https.request(request)
|
58
|
+
rescue SocketError
|
59
|
+
return false
|
60
|
+
end
|
57
61
|
case response.code
|
58
62
|
when "200"
|
59
63
|
begin
|
60
|
-
return
|
61
|
-
rescue
|
64
|
+
return MultiJson.load(response.body)
|
65
|
+
rescue MultiJson::LoadError
|
62
66
|
return Rack::Utils.parse_nested_query(response.body)
|
63
67
|
end
|
64
68
|
when "401"
|
data/oauth_twitter.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth_twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daiwei Lu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04
|
11
|
+
date: 2013-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.4.5
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: multi_json
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.7'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.7'
|
55
69
|
description: Simple twitter oauth api to add methods to module for rails module.
|
56
70
|
email:
|
57
71
|
- daiweilu123@gmail.com
|