tweetlr 0.1.34 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tweetlr/processors/tumblr.rb +24 -20
- data/lib/tweetlr.rb +1 -1
- data/tweetlr.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59b62081f6978ecf30436ffefd430838120cb7fe
|
4
|
+
data.tar.gz: 888c03e1527f95ead7c1190d09b09f46ba791285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 496bf4ebdc655107c2e548ad1511971877d90055360a5da51332bd4a1d69a661a893dc45e6296d6731f6ff430acbbd171e075d386c09ee98e91805ae0d8e6540
|
7
|
+
data.tar.gz: 882a3516daf69ac2bd89e0fda21f07c24aa999d52857cf8f2ab7dbfa3e6db460ab01cabd544e364d24d2105873d7b55aec7a3fec95f5d6d5540ba89d74ab707d
|
@@ -28,29 +28,33 @@ module Tweetlr::Processors
|
|
28
28
|
post_response = nil
|
29
29
|
|
30
30
|
if base_hostname && access_token_key && access_token_secret
|
31
|
+
begin
|
32
|
+
consumer = OAuth::Consumer.new(tumblr_oauth_api_key, tumblr_oauth_api_secret,
|
33
|
+
{ :site => 'http://www.tumblr.com',
|
34
|
+
:request_token_path => '/oauth/request_token',
|
35
|
+
:authorize_path => '/oauth/authorize',
|
36
|
+
:access_token_path => '/oauth/access_token',
|
37
|
+
:http_method => :post } )
|
31
38
|
|
32
|
-
|
33
|
-
{ :site => 'http://www.tumblr.com',
|
34
|
-
:request_token_path => '/oauth/request_token',
|
35
|
-
:authorize_path => '/oauth/authorize',
|
36
|
-
:access_token_path => '/oauth/access_token',
|
37
|
-
:http_method => :post } )
|
39
|
+
access_token = OAuth::AccessToken.new(consumer, access_token_key, access_token_secret)
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
41
|
+
post_response = access_token.post(
|
42
|
+
"http://api.tumblr.com/v2/blog/#{base_hostname}/post", {
|
43
|
+
:type => type,
|
44
|
+
:source => options[:source],
|
45
|
+
:caption => options[:caption],
|
46
|
+
:date => options[:date],
|
47
|
+
:tags => tags,
|
48
|
+
:state => options[:state],
|
49
|
+
:generator => GENERATOR
|
50
|
+
}
|
51
|
+
)
|
52
|
+
rescue Exception => e
|
53
|
+
log.error "Error posting to tumblr: #{e}"
|
54
|
+
raise e
|
55
|
+
end
|
56
|
+
post_response
|
52
57
|
end
|
53
|
-
post_response
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
data/lib/tweetlr.rb
CHANGED
data/tweetlr.gemspec
CHANGED