Skip to content

Instantly share code, notes, and snippets.

View robinsloan's full-sized avatar

Robin Sloan robinsloan

View GitHub Profile
@robinsloan
robinsloan / langoliers.rb
Last active April 7, 2024 13:22
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
@robinsloan
robinsloan / shh.rb
Last active August 18, 2023 12:09
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
@robinsloan
robinsloan / archival-langoliers.rb
Last active February 8, 2023 11:15
Tweet delete script using your Twitter archive as an index
require "rubygems"
require "twitter"
require "json"
require "csv"
#require "date"
# things you must configure
TWITTER_USER = "your_twitter_username"
MAX_AGE_IN_DAYS = 7 # anything older than this is deleted
@robinsloan
robinsloan / template.html
Last active December 28, 2022 03:17
Just a super simple HTML email template
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="width=device-width" name="viewport" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="generator" content="The very hands of Sloan"/>
<base href="https://fat.gold/" />
<style type="text/css">
@robinsloan
robinsloan / unfave.rb
Last active June 5, 2022 21:32
Unfave script, because why not??
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@robinsloan
robinsloan / pcal.rb
Created March 11, 2015 17:42
Add entries for prime-numbered weekdays to your Google calendar. Useful to literally no one but me.
require "rubygems"
require "google_calendar"
require "date"
require "prime"
# Create an instance of the calendar.
cal = Google::Calendar.new(:client_id => "foo"
:client_secret => "bar",
:calendar => "blee",
@robinsloan
robinsloan / wiggletech.html
Last active October 12, 2021 07:31
WiggleTech
<html>
<head>
<style type="text/css">
body {
font-family: Arial, sans-serif;
font-size: 64px;
}
@robinsloan
robinsloan / sync-list.rb
Created July 20, 2021 02:50
This script will sync your current followings to one of your lists. It will add users to the list who you are following, and remove users from the list who you are not following.
require "rubygems"
require "twitter"
require "date"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
@robinsloan
robinsloan / save-followings.rb
Created April 6, 2013 16:52
Export IDs of the people you're following on Twitter.
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
TWITTER_USER = "blahblah"
# get these from dev.twitter.com
CONSUMER_KEY = "blahblah"
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
TWITTER_USER = "your_username_here"
TIMEOUT = 1 # increment this if you're getting a lot of rate limit errors
# get these from dev.twitter.com