Skip to content

Instantly share code, notes, and snippets.

@apassant
apassant / spotitags.py
Created May 14, 2015 12:08
A wrapper to tag spotify album covers from a given artist using the Clarifai Deep-learning API.
from clarifai.client import ClarifaiApi
import spotipy
class SpotiTags(ClarifaiApi):
"""
A wrapper to tag spotify album covers from a given artist
using the Clarifai Deep-learning API.
Requires to set-up the Clarifai API first.
@apassant
apassant / album_stats.py
Created October 3, 2014 22:26
Get an album stats (mood and tempo) using the Gracenote API
class AlbumStats(object):
"""
Get stats (mood and tempo) about an album using the Gracenote API.
Requires:
1) A Gracenote API key - https://developer.gracenote.com/
2) pygn - https://github.com/cweichen/pygn
Example:
# -*- coding: utf-8 -*-
######################################################
## (c) 2012-2013 MDG Web limited - MIT licence
######################################################
import cPickle
class RedisCache(object):
"""Redis cache"""
@apassant
apassant / tcht.py
Created August 16, 2013 18:39
Secure your tickets for the TC Hackathon
import urllib
from twilio.rest import TwilioRestClient
twilio_account = "xxx"
twilio_token = "xxx"
twilio_from = "xxx"
twilio_to = "xxxx"
eventbrite = 'http://sfhackathon2013-eorg.eventbrite.com/'
data = urllib.urlopen(eventbrite).read().lower()