Skip to content

Instantly share code, notes, and snippets.

@mackuba
Created May 22, 2024 21:53
Show Gist options
  • Save mackuba/bcbba202b3979c15e68546d295865280 to your computer and use it in GitHub Desktop.
Save mackuba/bcbba202b3979c15e68546d295865280 to your computer and use it in GitHub Desktop.
Find Joe's follows who opted in to Bridgy
#!/usr/bin/env ruby
## gem install minisky
require 'minisky'
sky = Minisky.new('api.bsky.app', nil, progress: '.')
joe_follows = sky.fetch_all('app.bsky.graph.getFollows', { actor: 'mergesort.me', limit: 100 }, field: 'follows')
ap_followers = sky.fetch_all('app.bsky.graph.getFollowers', { actor: 'ap.brid.gy', limit: 100 }, field: 'followers')
list = joe_follows.map { |x| [x['did'], x['handle']] } & ap_followers.map { |x| [x['did'], x['handle']] }
list.each do |did, handle|
puts "#{did} (#{handle})"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment