lib/ayadn/view.rb in ayadn-2.0.12 vs lib/ayadn/view.rb in ayadn-2.1

- old
+ new

@@ -69,11 +69,11 @@ end count = bucket.size if options[:username] bucket.sort_by! { |obj| obj[1] } elsif options[:name] - bucket.sort_by! { |obj| obj[2].downcase } + bucket.sort_by! { |obj| obj[2] } elsif options[:posts] bucket.sort_by! { |obj| [obj[5], obj[1]] }.reverse! elsif options[:date] bucket.keep_if { |obj| !obj[6].nil? } bucket.sort_by! { |obj| obj[6]["created_at"] }.reverse! @@ -95,11 +95,11 @@ date = @workers.parsed_time(obj[6]["created_at"]) mentions = @workers.extract_mentions(obj[6]) hashtags = @workers.extract_hashtags(obj[6]) text = @workers.colorize_text(obj[6]["text"], mentions, hashtags) total = "(#{obj[5]} posts)" - name = obj[2].nil? ? "(no name)" : obj[2] + name = obj[2] == "" ? "(no name)" : obj[2] colored_total = total.color(Settings.options[:colors][:link]) colored_name = name.color(Settings.options[:colors][:name]) colored_date = date.color(Settings.options[:colors][:date]) puts "#{colored_username} #{colored_name} #{colored_date} #{colored_total}\n" newline() @@ -216,18 +216,18 @@ view << "\nLocale\t\t\t".color(:cyan) + content['locale'].color(Settings.options[:colors][:excerpt]) view << "#{padding}Posts\t\t\t".color(:cyan) + content['counts']['posts'].to_s.color(Settings.options[:colors][:excerpt]) - unless show_ranks == false - # this is ok for one user, but do not call this in a loop - # do call them all at once instead if many - ranks = NiceRank.new.get_posts_day([content['id'].to_i]) - unless ranks.empty? - view << "#{padding}Posts/day\t\t".color(:cyan) + ranks[0][:posts_day].to_s.color(Settings.options[:colors][:excerpt]) - end - end + # unless show_ranks == false + # # this is ok for one user, but do not call this in a loop + # # do call them all at once instead if many + # ranks = NiceRank.new.get_posts_day([content['id'].to_i]) + # unless ranks.empty? + # view << "#{padding}Posts/day\t\t".color(:cyan) + ranks[0][:posts_day].to_s.color(Settings.options[:colors][:excerpt]) + # end + # end view << "#{padding}Following\t\t".color(:cyan) + content['counts']['following'].to_s.color(Settings.options[:colors][:excerpt]) view << "\nFollowers\t\t".color(:cyan) + content['counts']['followers'].to_s.color(Settings.options[:colors][:excerpt]) if content['username'] == Settings.config[:identity][:username] && !token.nil? @@ -512,10 +512,9 @@ next if content[:nicerank] == false end unless content[:nicerank] == false next if content[:nicerank] < Settings.options[:nicerank][:threshold] next if content[:is_human] == 0 - next if content[:real_person] == 0 end filtered[id] = content end return filtered end