tumblr_wrapper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -34,6 +34,7 @@ then authorize in browser here:
34
34
 
35
35
  tumblr oauth is strict, you need to save the oauth verifier from the response:
36
36
 
37
+ client.request_token(request_token, request_token_secret) // set the request token again
37
38
  access_token = client.access_token("OAUTH VERIFIER")
38
39
 
39
40
  If you have the token and secret for your user:
@@ -1,5 +1,5 @@
1
1
  class TumblrWrapper::Client
2
- attr_reader :consumer, :request_token
2
+ attr_reader :consumer
3
3
  def initialize
4
4
  @consumer = OAuth::Consumer.new(
5
5
  TumblrWrapper.consumer_key,
@@ -21,6 +21,15 @@ class TumblrWrapper::Client
21
21
  end
22
22
  end
23
23
 
24
+ def request_token(token = nil, secret=nil)
25
+ if token && secret
26
+ OAuth::RequestToken.new(consumer, token, secret)
27
+ else
28
+ @request_token
29
+ end
30
+ @request_token
31
+ end
32
+
24
33
  def access_token_from_hash(token_hash)
25
34
  @access_token = OAuth::AccessToken.from_hash(consumer, token_hash)
26
35
  end
@@ -1,3 +1,3 @@
1
1
  module TumblrWrapper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - rheaton