lib/ayadn/stream.rb in ayadn-2.0.4 vs lib/ayadn/stream.rb in ayadn-2.0.5
- old
+ new
@@ -128,9 +128,24 @@
@view.downloading(options)
show_raw_list(username, :followings, options)
list = @api.get_followings(username)
@check.auto_save_followings(list)
Errors.no_data('followings') if list.empty?
+ if options["lastpost"]
+ count = list.size
+ @workers.thor.say_status :downloading, "please wait, it may take a while...", :red
+ puts "\n"
+ idx = 0
+ list.each do |str_id,obj|
+ idx += 1
+ tmp_username = "@#{obj[0]}"
+ colored_username = tmp_username.color(Settings.options[:colors][:username])
+ iter = "#{idx}/#{count}"
+ @workers.thor.say_status iter.to_sym, "last post from #{colored_username}", :cyan
+ resp = @api.get_posts(tmp_username, {count: 1})
+ obj << resp["data"][0]
+ end
+ end
@view.list(:followings, list, username, options)
Databases.add_to_users_db_from_list(list)
end
def followers(username, options)