lib/ayadn/workers.rb in ayadn-1.2.7 vs lib/ayadn/workers.rb in ayadn-1.2.8
- old
+ new
@@ -222,15 +222,15 @@
tags = []
post['entities']['hashtags'].each { |h| tags << h['name'] }
tags
end
- def build_channels(data)
+ def build_channels(data, options = {})
channels = []
data.each { |ch| channels << ch }
bucket = []
- puts "Downloading new channels and unknown users ids.\nThis is a one time operation, ids are being recorded in a database.\n\nPlease wait, it could take a while if you have many channels...".color(:cyan)
+ puts "Downloading new channels and unknown users ids.\nThis is a one time operation, ids are being recorded in a database.\n\nPlease wait, it could take a while if you have many channels...".color(:cyan) unless options[:channels]
chan = Struct.new(:id, :num_messages, :subscribers, :type, :owner, :annotations, :readers, :editors, :writers, :you_subscribed, :unread, :recent_message_id, :recent_message)
channels.each do |ch|
unless ch['writers']['user_ids'].empty?
usernames = []
ch['writers']['user_ids'].each do |id|
@@ -292,12 +292,12 @@
db[active][:handle]
end
def self.remove_arobase_if_present args
args.map! do |username|
- username = username.chars
- username.shift if username.first == "@"
- username.join
+ temp = username.chars
+ temp.shift if temp.first == "@"
+ temp.join
end
args
end
def self.extract_users(resp)