-
-
Save oieioi/c474f307861279aeeacb to your computer and use it in GitHub Desktop.
Trace back home or user timeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
Earthquake.once do | |
module TwitterOAuth | |
class Client | |
def favorites_list(user, **options) | |
options = URI.encode_www_form(options) | |
get("/favorites/list.json?screen_name=#{user}&#{options}") | |
end | |
end | |
end | |
end | |
Earthquake.init do | |
tracer = ->(timeline_method, *args, **options) do | |
loop do | |
tweets = twitter.__send__(timeline_method, *args, options) | |
#p tweets | |
break if tweets.empty? | |
options.update(max_id: tweets.last["id"].pred) | |
puts_items tweets.reverse | |
break unless confirm("continue?", :y) | |
end | |
end | |
command :favorites_trace do |m| | |
q = m[1] | |
tracer[:favorites_list, q] | |
end | |
help :favorites_tarce, "trace back users favs", <<-HELP | |
HELP | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment