Favourite songs of 2015 (excluding Hamilton)

My top thirty tracks of the year that aren’t on the Hamilton recording.

Spotify playlist
YouTube playlist

Starts with my top ten for Hottest 100 purposes, the rest are ordered by (Spotify) track length. This year I restricted myself to one track per artist in the top ten. Was itching to have more Barnett, Grimes, Torres.

  1. Pedestrian At Best – Courtney Barnett
  2. Sprinter – Torres
  3. California – Grimes
  4. Fourth of July – Sufjan Stevens
  5. Clearest Blue – CHVRCHES
  6. Electric Indigo – The Paper Kites
  7. Price Tag – Sleater-Kinney
  8. Huarache Lights – Hot Chip
  9. Automaton – Là-bas
  10. Puppet Theatre (feat. Peter, Bjorn and John) – Claptone
  • Waste the Alphabet – Dick Diver
  • Nobody Really Cares If You Don’t Go To The Party – Courtney Barnett
  • Fading Out – Lurch & Chief
  • Too Much Time Together – San Cisco
  • Never Ending Circles – CHVRCHES
  • Running With The Wolves – AURORA
  • Hiding To Nothing – Bad//Dreems
  • Distant Past – Everything Everything
  • Born Again Teen – Lucius
  • Cream On Chrome – Ratatat
  • Leave A Trace – CHVRCHES
  • A Heroine – Holy Holy
  • Boys Latin – Panda Bear
  • Flesh without Blood – Grimes
  • Son, You Are No Island – Torres
  • Into The Cave – Lonelady
  • Poison Drum – Gang of Youths
  • Evil Eyes – Róisín Murphy
  • Let It Happen – Tame Impala
  • Blackstar – David Bowie

Honourable Mentions:

The Hamilton Original Broadway Cast Recording is my album of the decade, hands-down. Nothing came close to topping it this year. But being a musical – and a good musical – most of its songs require the context of the others, so it’s difficult to name them in a list like this.

Since it’s primarily a hip-hop musical, Cabinet Battle #1 is the best example of the show:

But if there was going to be a breakaway pop hit it would probably be Wait For It, sung by Leslie Odom Jr’s Aaron Burr:

Delete old tweets selectively using Python and Tweepy

For some time I’ve used an online service to delete tweets that are more than one week old. I do this because I use Twitter for levity, for throwaway comments and retweets on issues of the day, and I don’t really want those saved for posterity. Thanks to search crawlers and caches I can never be certain that tweets are gone forever, but this is a small step in that direction.

When I joined Keybase I discovered that I needed to prevent my ‘proof’ tweet from being deleted, and the simple method used by the online deletion service was no longer an option. My solution uses an exception list containing the IDs of the tweets I wish to save, and these are ignored when their contemporaries are merged with the infinite.

I’ve written a Python script that uses Tweepy to scan the contents of my timeline and delete any tweet that meets two criteria – more than seven days old and not in my exception list. It’s very simple, there are probably better ways of doing it (please let me know), but it works well for me as a nightly cron job.

Please note that since I’ve been deleting my old tweets this way for some time I’ve never had issues with the Twitter API rate limits. Every deletion is an API call, so if you have many tweets you may need to consider initially limiting the number returned via the .items() method. This is demonstrated in the Tweepy cursor tutorial.

To get the required authentication keys you will need to register a Twitter application.

Update

Since my initial post I’ve added functionality to unfavor (or ‘unfavorite’) tweets, too. I’ve included the full script below.

#!/usr/bin/env python

import tweepy
from datetime import datetime, timedelta

# options
test_mode = False
verbose = False
delete_tweets = True
delete_favs = True
days_to_keep = 7

tweets_to_save = [
    573245340398170114, # keybase proof
    573395137637662721, # a tweet to this very post
]
favs_to_save = [
    362469775730946048, # tony this is icac
]

# auth and api
consumer_key = 'XXXXXXXX'
consumer_secret = 'XXXXXXXX'
access_token = 'XXXXXXXX'
access_token_secret = 'XXXXXXXX'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)

# set cutoff date, use utc to match twitter
cutoff_date = datetime.utcnow() - timedelta(days=days_to_keep)

# delete old tweets
if delete_tweets:
    # get all timeline tweets
    print "Retrieving timeline tweets"
    timeline = tweepy.Cursor(api.user_timeline).items()
    deletion_count = 0
    ignored_count = 0

    for tweet in timeline:
        # where tweets are not in save list and older than cutoff date
        if tweet.id not in tweets_to_save and tweet.created_at < cutoff_date:
            if verbose:
                print "Deleting %d: [%s] %s" % (tweet.id, tweet.created_at, tweet.text)
            if not test_mode:
                api.destroy_status(tweet.id)
            
            deletion_count += 1
        else:
            ignored_count += 1

    print "Deleted %d tweets, ignored %d" % (deletion_count, ignored_count)
else:
    print "Not deleting tweets"
    
# unfavor old favorites
if delete_favs:
    # get all favorites
    print "Retrieving favorite tweets"
    favorites = tweepy.Cursor(api.favorites).items()
    unfav_count = 0
    kept_count = 0

    for tweet in favorites:
        # where tweets are not in save list and older than cutoff date
        if tweet.id not in favs_to_save and tweet.created_at < cutoff_date:
            if verbose:
                print "Unfavoring %d: [%s] %s" % (tweet.id, tweet.created_at, tweet.text)
            if not test_mode:
                api.destroy_favorite(tweet.id)
            
            unfav_count += 1
        else:
            kept_count += 1

    print "Unfavored %d tweets, ignored %d" % (unfav_count, kept_count)
else:
    print "Not unfavoring tweets"

Favourite songs of 2014

My top thirty tracks of the year. Starts with my top ten, the rest are ordered by (Spotify) track length.

Spotify playlist
YouTube playlist

“I’m wearing Win Butler’s hair
There’s a scalpless singer of a Montreal rock band somewhere
And he’s all right”

  1. Jessica Lea Mayfield – Do I Have The Time
  2. Röyksopp & Robyn – Monument (The Inevitable End Version)
  3. Happyness – Montreal Rock Band Somewhere
  4. St. Vincent – Birth In Reverse
  5. La Roux – Kiss And Not Tell
  6. Bombay Bicycle Club – Luna
  7. Alvvays – Archie, Marry Me
  8. Eleanor Dunlop – Disguise
  9. The Preatures – Better Than It Ever Could Be
  10. Bertie Blackman – War Of One
  • Bad//Dreems – Dumb Ideas
  • The Bohicas – XXX
  • SBTRKT – NEW DORP. NEW YORK
  • Broods – Mother & Father
  • East – Your Ghost
  • St. Vincent – Digital Witness
  • The Griswolds – Beware The Dog
  • The Preatures – Somebody’s Talking
  • Highasakite – Darth Vader
  • Ecca Vandal – White Flag
  • Kimbra – 90s Music
  • First Aid Kit – My Silver Lining
  • Jack White – Lazaretto
  • CHVRCHES – Bela Lugosi’s Dead
  • The Babe Rainbow – Secret Enchanted Broccoli Forest
  • Superfood – Right On Satellite
  • Interpol – All The Rage Back Home
  • City Calm Down – Pavement
  • Glass Animals – Pools
  • Lana Del Rey – Shades Of Cool

Honourable mention:

My top thirty are those I can play over and over again, and although this one doesn’t qualify on that count it’s the most entertaining song of 2014. And it did us a favour by allowing us to listen to the catchy tune of the original without being subjected to its lyrics.