Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fanburst autofollow script
require 'json'
require 'curb'
# follows artists on fanburst.com using their user_id
# confirmed 4.20.17 that 22,300+ profiles exist
# artist id can be found via 'data' attribute on a profile's "follow" button
COOKIE = 'REDACTED'
CSRF_TOKEN = 'REDACTED'
def follow_artist(user_id)
params = {followed_id: user_id}
resp = Curl.post("https://fanburst.com/relationships", params.to_json) do |curl|
curl.headers['Content-Type'] = 'application/json'
curl.headers['Cookie'] = COOKIE
curl.headers['X-csrf-token'] = CSRF_TOKEN
end
puts resp.status
end
def unfollow_artist(user_id)
params = {followed_id: user_id}
resp = Curl.delete("https://fanburst.com/relationships", params.to_json) do |curl|
curl.headers['Content-Type'] = 'application/json'
curl.headers['Cookie'] = COOKIE
curl.headers['X-csrf-token'] = CSRF_TOKEN
end
puts resp.status
end
# starting point: note how many followers you have, then add 1
artist_profiles = []
starting_point = 3250
(starting_point...starting_point+650).each {|p| artist_profiles << p}
# unfollow profiles followed previously, before following new ones
artist_profiles.each do |profile|
puts "trying to unfollow artist #{profile}..."
unfollow_artist(profile)
end
artist_profiles.each do |profile|
puts "trying to follow artist #{profile}..."
follow_artist(profile)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.