instafavs 0.0.3 → 0.0.4

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/README.textile CHANGED
@@ -2,7 +2,7 @@ h1. instafavs
2
2
 
3
3
  by Brad Bollenbach
4
4
 
5
- instafavs extracts links from favorited tweets and sends them to Instapaper.
5
+ instafavs extracts links from favourited tweets and sends them to Instapaper.
6
6
 
7
7
  h2. Install
8
8
 
@@ -20,13 +20,13 @@ The install instafavs into your crontab:
20
20
  $ crontab -e
21
21
  </pre>
22
22
 
23
- To check your Twitter feed every 5 minutes for new favorites:
23
+ To check your Twitter feed every 5 minutes for new favourites:
24
24
 
25
25
  <pre>
26
26
  # This is what works for my rvm-based setup!
27
27
  */5 * * * * bash --login -c instafavs
28
28
  </pre>
29
29
 
30
- instafavs only polls your latest 20 favorites each time, so you should ensure your cron job is set at a reasonable enough interval that no favorites will be missed.
30
+ instafavs only polls your latest 20 favourites each time, so you should ensure your cron job is set at a reasonable enough interval that no favourites will be missed.
31
31
 
32
32
  Please email any feedback or bug reports to "bradb@30sleeps.com":mailto:bradb@30sleeps.com.
data/bin/instafavs CHANGED
@@ -16,15 +16,12 @@ end
16
16
  def send_links_from_fav_tweets_to_instapaper
17
17
  Instafavs::Config.load!
18
18
 
19
- seen_fav_ids = Set.new
20
- favorites = Twitter.favorites(Instafavs::Config.twitter_username)
21
- verbose("found #{favorites.size} latest favorites for user #{Instafavs::Config.twitter_username}")
22
- favorites.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
19
+ last_update_run_at = Instafavs::Config.last_update_run_at
20
+ this_update_run_at = Time.now.utc
21
+ twitter_username = Instafavs::Config.twitter_username
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}")
24
+ favourites.each_with_index do |f, i|
28
25
  verbose("scanning #{f.text} for urls to extract")
29
26
  f.text.scan(%r{http(?:s?)://[^ ]+}).each do |url|
30
27
  verbose("found #{url}, sending to instapaper", 2)
@@ -33,8 +30,8 @@ def send_links_from_fav_tweets_to_instapaper
33
30
  :password => Instafavs::Config.instapaper_password })
34
31
  end
35
32
  end
36
- verbose("updating config with #{seen_fav_ids.size} latest seen ids")
37
- Instafavs::Config.update_last_seen_fav_ids!(seen_fav_ids)
33
+ verbose("updating last run at timestamp")
34
+ Instafavs::Config.last_update_run_at!(this_update_run_at)
38
35
  end
39
36
 
40
37
  def collect_config_info
data/instafavs.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.authors = ["Brad Bollenbach"]
10
10
  s.email = ["bradb@30sleeps.com"]
11
11
  s.homepage = "https://github.com/bradb/instafavs"
12
- s.summary = %q{Extract links from favorited tweets and send them to Instapaper}
12
+ s.summary = %q{Extract links from favourited tweets and send them to Instapaper}
13
13
  s.add_dependency("twitter", ">= 1.1.2")
14
14
  s.add_dependency("httparty", ">= 0.7.3")
15
15
  s.post_install_message = <<SETUP
@@ -1,3 +1,3 @@
1
1
  module Instafavs
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brad Bollenbach
@@ -102,6 +102,6 @@ rubyforge_project: instafavs
102
102
  rubygems_version: 1.3.7
103
103
  signing_key:
104
104
  specification_version: 3
105
- summary: Extract links from favorited tweets and send them to Instapaper
105
+ summary: Extract links from favourited tweets and send them to Instapaper
106
106
  test_files: []
107
107