How to List All Ignores (Mutes) in Ruby

in #radiator8 years ago

Along the same lines as getting a list of all of your followers, here's a way to see who is ignoring (muted) you.

Like before, we use Radiator, but this time we list everyone who mutes a specified account. The only prerequisite is having bundler. You can get bundler with this command:

$ gem install bundler

I've tested it on various versions of ruby. The oldest one I got it to work was:

ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-darwin14.4.0]

First, make a project folder:

$ mkdir radiator
$ cd radiator

Create a file named Gemfile containing:

source 'https://rubygems.org'
gem 'radiator', github: 'inertia186/radiator'

Then run the command:

$ bundle install

Create a file named all_ignores.rb containing:

require 'rubygems'
require 'bundler/setup'

Bundler.require

puts "Usage: ruby #{__FILE__} <account>" and return if ARGV.empty?

api = Radiator::FollowApi.new(url: 'https://node.steem.ws:443')
ignores = []
count = -1

until count == ignores.size
  count = ignores.size
  response = api.get_followers(ARGV.first, ignores.last, 'ignore', 100)
  ignores += response.result.map(&:follower)
  ignores = ignores.uniq
  sleep 1
end

puts ignores

Then run it:

$ ruby all_ignores.rb ned

ruby

I want to thank @tuck-fheman for helping me test this script.

Sort:  

Necro thread...the dead have risen!

Yes, that's the power of ChainBB. To raise the dead.