tweetlr 0.1.34 → 0.1.35

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c9dad0a0520b23a7bad8320b9201b8532565840
4
- data.tar.gz: c978579a001652cc5f2c6b7647936341c908326d
3
+ metadata.gz: 59b62081f6978ecf30436ffefd430838120cb7fe
4
+ data.tar.gz: 888c03e1527f95ead7c1190d09b09f46ba791285
5
5
  SHA512:
6
- metadata.gz: 1ea2c9e42f4902069eefed131f2a358912b8594588d532e01cd9d387ed1fedf8502fd579a8af43edfabf9ac4e045b2db6e5c0a594c9bcc01ed15393bc5d4b2b5
7
- data.tar.gz: ec2d6c170670baf3439de8c87ddea5d6553dfd7be8fa1cbcfdd9c9fd4bb70ec0a0b0eab3eaf67f046103f0f72ff7f184a9189df64376cf1e702af6feaf297340
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
- 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 } )
39
+ access_token = OAuth::AccessToken.new(consumer, access_token_key, access_token_secret)
38
40
 
39
- access_token = OAuth::AccessToken.new(consumer, access_token_key, access_token_secret)
40
-
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
- )
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
@@ -2,7 +2,7 @@ require 'tweetlr/log_aware'
2
2
  require 'tweetlr/core'
3
3
 
4
4
  module Tweetlr
5
- VERSION = '0.1.34'
5
+ VERSION = '0.1.35'
6
6
 
7
7
  API_ENDPOINT_TWITTER = 'http://search.twitter.com/search.json'
8
8
  API_ENDPOINT_TUMBLR = 'http://www.tumblr.com'
data/tweetlr.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "tweetlr"
3
- s.version = "0.1.34"
3
+ s.version = "0.1.35"
4
4
  s.author = "Sven Kraeuter"
5
5
  s.email = "sven.kraeuter@gmail.com"
6
6
  s.homepage = "http://tweetlr.5v3n.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tweetlr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Kraeuter