tweetlr 0.1.36 → 0.1.37
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 +4 -4
- data/lib/tweetlr.rb +1 -1
- data/lib/tweetlr/combinators/twitter_tumblr.rb +5 -1
- data/lib/tweetlr/processors/photo_service.rb +2 -0
- 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: 6bad6b9fecdbf193dcd34f69f1449dedbde80031
|
4
|
+
data.tar.gz: 11cb0c84349c462497bdd1bafa182f73c3acf22b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a85243e24df556b756839de2e34a2d92112297e5d95b08d721aa4f7ef5cb17dda52fe84542cab918d7ee1f18b3109a46cd9430cc40aac65d872255dbb581171f
|
7
|
+
data.tar.gz: ffa7bcee67c79a6667d22ed2baaa5efc81e4e6f32f823097e8003819b502e15158036ebf19c218b793fa9bbe54da6aa6d8251bfed36b027fa2a02531ad2a1856
|
data/lib/tweetlr.rb
CHANGED
@@ -12,6 +12,7 @@ module Tweetlr::Combinators
|
|
12
12
|
end
|
13
13
|
#extract a linked image file's url from a tweet. first found image will be used.
|
14
14
|
def self.extract_image_url(tweet, embedly_key=nil)
|
15
|
+
log.debug "extracting image url..."
|
15
16
|
links = Tweetlr::Processors::Twitter::extract_links tweet
|
16
17
|
image_url = nil
|
17
18
|
if links
|
@@ -20,6 +21,7 @@ module Tweetlr::Combinators
|
|
20
21
|
return image_url if Tweetlr::Processors::PhotoService::photo? image_url
|
21
22
|
end
|
22
23
|
end
|
24
|
+
log.debug "extracting image url done."
|
23
25
|
image_url
|
24
26
|
end
|
25
27
|
#generate the data for a tumblr photo entry by parsing a tweet
|
@@ -32,8 +34,10 @@ private
|
|
32
34
|
whitelist = options[:whitelist]
|
33
35
|
whitelist.each {|entry| entry.downcase!} if (whitelist && whitelist.size != 0)
|
34
36
|
if !Tweetlr::Processors::Twitter::retweet? tweet['text']
|
35
|
-
log.debug "tweet: #{tweet}"
|
37
|
+
log.debug "tweet: #{tweet['text']}"
|
36
38
|
tumblr_post = prepare_tumblr_post options, tweet, whitelist
|
39
|
+
log.debug "tumblr post: #{tumblr_post}"
|
40
|
+
tumblr_post
|
37
41
|
end
|
38
42
|
end
|
39
43
|
def self.prepare_tumblr_post(options, tweet, whitelist)
|
@@ -124,8 +124,10 @@ module Tweetlr::Processors
|
|
124
124
|
private
|
125
125
|
def self.process_link(link, embedly_key)
|
126
126
|
url = nil
|
127
|
+
log.info "embedly processing the link..."
|
127
128
|
url = image_url_embedly link, embedly_key
|
128
129
|
if url.nil? #fallback to self written image extractors
|
130
|
+
log.info "embedly wasn't able to process the link, using self written extractors..."
|
129
131
|
url = image_url_eyeem link if link.index 'eyeem.com'
|
130
132
|
url = image_url_instagram link if (link.index('instagr.am') || link.index('instagram.com'))
|
131
133
|
url = image_url_twitpic link if link.index 'twitpic'
|
data/tweetlr.gemspec
CHANGED