Skip to content

Instantly share code, notes, and snippets.

@jeena jeena/no-retweet.rb
Created Aug 30, 2015

Embed
What would you like to do?
#!/usr/bin/env ruby -wU
#
# This script uses the command line twitter client https://github.com/twitter/twurl
# You have to authorize Twurl one time before you can use ist, please read the
# README for Twurl which describes how to do it.
# What it basically does is it sets the flag that you don't want to see
# any retweets of any users at all.
require 'json'
friends = JSON.parse(`twurl "/1.1/friends/ids.json"`)["ids"]
no_retweets = JSON.parse(`twurl "/1.1/friendships/no_retweets/ids.json"`)
(friends - no_retweets).each do |id|
puts `twurl -X POST "/1.1/friendships/update.json" -d "user_id=#{id}&retweets=false"`
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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.