Skip to content

Instantly share code, notes, and snippets.

View plamere's full-sized avatar

Paul Lamere plamere

View GitHub Profile
@plamere
plamere / dedup.py
Created June 25, 2011 13:05
dedup.py - uses echoprint to find duplicates in a music collection
#!/usr/bin/python
import sys
import os
import pprint
import subprocess
import pickle
import atexit
import simplejson as json
sys.path.insert(0, "../API")
@plamere
plamere / index.html
Created December 6, 2011 13:45
Demonstration of how to call the Echo Nest API from a Spotify App
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Playlister</title>
<link rel="stylesheet" href="sp://import/css/adam.css">
<link rel="stylesheet" href="styles.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
@plamere
plamere / your_chill.yaml
Last active April 23, 2019 10:08
Example of a YAML for a simple chill mix
your_favorite_chill_tracks:
title: your favorite chill tracks
description: just your most chill tracks
main: sequencer
config:
max_tracks: 30
components:
my_liked_tracks:
@plamere
plamere / virtues.txt
Created March 31, 2019 17:30
a list of all virtues
ability abundance acceptance accountability accuracy achievement acknowledgement acting on convictions activism adaptability administration/control adoration adventure advice affection aging gracefully allowing altruism amazement ambition anger at injustice anticipation apology appeasement appreciation appreciation of appreciation of beauty approbation appropriate conduct appropriate knowledge approval art assertiveness assumptions atonement attention attitude austerity authenticity authority authority/honesty autonomy awareness awe b balance beauty being true to oneself belief benevolence benignity bliss bravery c candor capacity to be loved capacity to love care caring caution celebration celibacy certainty chance change chaos character charity charm chastity cheerfulness chivalry choice citizenship civility clarity class cleanliness coincidence collaboration commitment communication communication/info communion community community/personalist community/supportive companionship compassion competition comple
@plamere
plamere / FetchTrackAndAnalysisData.js
Created April 9, 2012 09:39
Syncing Echo Nest analysis to Spotify playback
function fetchSongInfo(track) {
info('Getting song info for ' + track.name + ' by ' + track.artists[0].name);
var url = 'http://developer.echonest.com/api/v4/track/profile?api_key=N6E4NIOVYMTHNDM8J&callback=?';
var track_id = fromSpotify(track.uri);
$.getJSON(url, { id: track_id, format:'jsonp', bucket : 'audio_summary'}, function(data) {
if (checkResponse(data)) {
info("");
showTrackInfo(data.response.track);
fetchAnalysis(data.response.track);
@plamere
plamere / webtools.py
Last active February 20, 2017 00:46
a grab bag of python stuff that my sever code uses sometimes.
import os
import os.path
import hashlib
from httplib import HTTP
from urlparse import urlparse
import urllib
import urllib2
import simplejson as json
def get_export_map_for_directory(path, prefix = "/"):
@plamere
plamere / goats.txt
Created January 2, 2017 22:41
title_chain.py
$ python title_chain.py goats
1 Goats On A Boat by The Devil Wears Prada
2 Boat To Nowhere by Anoushka Shankar
3 Nowhere Man by Bryce Vine
4 Man Down by Rihanna
5 Down Under by Men At Work
6 Under Cover of Darkness by The Strokes
7 Darkness Between the Fireflies by Mason Jennings
8 Fireflies Made Out Of Dust by Happy Jawbone Family Band
@plamere
plamere / Playlist starting with Goats
Created January 2, 2017 22:34
Some examples of title_chain.py output
$ python title_chain.py goats
1 Goats On A Boat by The Devil Wears Prada
2 Boat To Nowhere by Anoushka Shankar
3 Nowhere Man by Bryce Vine
4 Man Down by Rihanna
5 Down Under by Men At Work
6 Under Cover of Darkness by The Strokes
7 Darkness Between the Fireflies by Mason Jennings
8 Fireflies Made Out Of Dust by Happy Jawbone Family Band
9 Dust & Gold by OKBADLANDS
<!DOCTYPE html>
<html>
<head>
<title>Echo Nest + Spotify Play Button Demo</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<link type="text/css" href="demo_styles.css" rel="stylesheet" />
</head>
<body>
@plamere
plamere / genre_playlist.py
Created January 16, 2014 12:44
example of using creating genre radio
import pyen
import sys
en = pyen.Pyen()
if len(sys.argv) < 2:
print 'Usage: python genre_playlist.py seed genre name'
else:
genre = ' '.join(sys.argv[1:])
response = en.get('playlist/static', type='genre-radio', genre_preset='core-best', genre=genre)