instafavs 0.0.4 → 0.0.5
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.
- data/bin/instafavs +10 -7
- data/lib/instafavs/version.rb +1 -1
- metadata +2 -2
data/bin/instafavs
CHANGED
@@ -16,12 +16,15 @@ end
|
|
16
16
|
def send_links_from_fav_tweets_to_instapaper
|
17
17
|
Instafavs::Config.load!
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
favourites = Instafavs.new_favourites_in_period(twitter_username, last_update_run_at, this_update_run_at)
|
23
|
-
verbose("found #{favourites.size} latest favourites for user #{twitter_username}")
|
19
|
+
seen_fav_ids = Set.new
|
20
|
+
favourites = Twitter.favorites(Instafavs::Config.twitter_username)
|
21
|
+
verbose("found #{favourites.size} latest favourites for user #{Instafavs::Config.twitter_username}")
|
24
22
|
favourites.each_with_index do |f, i|
|
23
|
+
seen_fav_ids << f.id_str
|
24
|
+
if Instafavs::Config.last_seen_fav_ids.include?(f.id_str)
|
25
|
+
verbose("skipping ##{i + 1} '#{f.text}', already seen")
|
26
|
+
next
|
27
|
+
end
|
25
28
|
verbose("scanning #{f.text} for urls to extract")
|
26
29
|
f.text.scan(%r{http(?:s?)://[^ ]+}).each do |url|
|
27
30
|
verbose("found #{url}, sending to instapaper", 2)
|
@@ -30,8 +33,8 @@ def send_links_from_fav_tweets_to_instapaper
|
|
30
33
|
:password => Instafavs::Config.instapaper_password })
|
31
34
|
end
|
32
35
|
end
|
33
|
-
verbose("updating
|
34
|
-
Instafavs::Config.
|
36
|
+
verbose("updating config with #{seen_fav_ids.size} latest seen ids")
|
37
|
+
Instafavs::Config.update_last_seen_fav_ids!(seen_fav_ids)
|
35
38
|
end
|
36
39
|
|
37
40
|
def collect_config_info
|
data/lib/instafavs/version.rb
CHANGED