Skip to content

Instantly share code, notes, and snippets.

View leemartin's full-sized avatar

Lee Martin leemartin

View GitHub Profile
@leemartin
leemartin / stratus-customization
Created March 1, 2012 03:49
Stratus Customization
<script type="text/javascript">
$(document).ready(function(){
$stratus({
auto_play: true,
download: false,
links: 'http://soundcloud.com/qotsa',
random: true
});
});
</script>
@leemartin
leemartin / stratus-installation
Created March 1, 2012 04:02
Stratus Installation
<script type="text/javascript">
$(document).ready(function(){
$.stratus({
links: 'http://soundcloud.com/foofighters/sets/wasting-light'
});
});
</script>
@leemartin
leemartin / callback.html
Created March 2, 2012 00:40
Stratus Callback
<!DOCTYPE html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Connect with SoundCloud</title>
</head>
<body onload="window.opener.setTimeout(window.opener.SC.connectCallback, 1)">
<b style="width: 100%; text-align: center;">This popup should automatically close in a few seconds</b>
</body>
</html>
@leemartin
leemartin / waveform.coffee
Created March 7, 2012 16:30
Waveform ImageData Node
app.get '/waveform', (req, res) ->
# If URL and Callback present
if req.param("url") && req.param("callback")
# Get the parameters
url = decodeURIComponent(req.param("url"))
callback = req.param("callback")
# Create a Bufferlist
@leemartin
leemartin / wave64.js
Created March 9, 2012 00:48
Wave64 Example
// Use the SoundCloud JS SDK to grab a track
SC.get("/tracks/38640984", function(track){
// Use jQuery's getJSON call to pass the waveform_url and callback to Wave64
$.getJSON('http://wave64.it/w?callback=?', { url: track.waveform_url }, function(data){
// Initialize a new image using the returned data
waveform = new Image();
waveform.src = data.data;
@leemartin
leemartin / wave64.html
Created March 16, 2012 19:23
$.wave64 Example
<html>
<head>
<title>SoundCloud $.wave64 Example</title>
<!-- Include jQuery, SoundCloud JS SDK, and the $.wave64 Plugin -->
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<script src='http://connect.soundcloud.com/sdk.js'></script>
<script src='http://wave64.it/jquery.wave64.js'></script>
<script type='text/javascript'>
@leemartin
leemartin / ontimedcomments.js
Created April 5, 2012 23:26
OnTimedComments Example
SC.initialize({
client_id: "YOUR_CLIENT_ID"
});
SC.whenStreamingReady(function() {
SC.stream(TRACK_ID, {
ontimedcomments: function(comments) {
var comment, _i, _len;
for (_i = 0, _len = comments.length; _i < _len; _i++) {
@leemartin
leemartin / topspin_vs_sc.js
Created April 12, 2012 13:58
TopSpin Purchase on SoundCloud
// Initialize JS SDK
SC.initialize({
client_id: "YOUR_CLIENT_ID",
redirect_uri: "http://example.com/callback.html",
});
// Connect to SoundCloud
SC.connect(function(){
// Update one of the user's tracks' purchase url
@leemartin
leemartin / widget.html
Created April 17, 2012 18:48
Email Unlock Widget
<iframe allowtransparency='true' frameborder='0' height='400' scrolling='no' src='YOUR_CAMPAIGN_URL/widget' width='300'></iframe>
@leemartin
leemartin / widget.html
Created April 17, 2012 18:48
Email Unlock Widget
<iframe allowtransparency='true' frameborder='0' height='400' scrolling='no' src='YOUR_CAMPAIGN_URL/widget' width='300'></iframe>