Skip to content

Instantly share code, notes, and snippets.

@jkischkel
Created October 9, 2012 10:28
Show Gist options
  • Save jkischkel/3857844 to your computer and use it in GitHub Desktop.
Save jkischkel/3857844 to your computer and use it in GitHub Desktop.
sctop
#!/usr/bin/ruby
require 'rubygems'
require 'soundcloud'
puts <<'EOT'
_____/\\\\\\\\\\\__________/\\\\\\\\\____________/\\\\\\\\\\\\\\\_______/\\\\\_______/\\\\\\\\\\\\\___
___/\\\/////////\\\_____/\\\////////____________\///////\\\/////______/\\\///\\\____\/\\\/////////\\\_
__\//\\\______\///____/\\\/___________________________\/\\\_________/\\\/__\///\\\__\/\\\_______\/\\\_
___\////\\\__________/\\\_____________________________\/\\\________/\\\______\//\\\_\/\\\\\\\\\\\\\/__
______\////\\\______\/\\\_____________________________\/\\\_______\/\\\_______\/\\\_\/\\\/////////____
_________\////\\\___\//\\\____________________________\/\\\_______\//\\\______/\\\__\/\\\_____________
__/\\\______\//\\\___\///\\\__________________________\/\\\________\///\\\__/\\\____\/\\\_____________
_\///\\\\\\\\\\\/______\////\\\\\\\\\_________________\/\\\__________\///\\\\\/_____\/\\\_____________
___\///////////___________\/////////__________________\///_____________\/////_______\///______________
EOT
amount = Integer(ARGV.first || "10")
client = Soundcloud.new(:client_id => '1b81ad505905f680dc1042a30730138d')
tracks = client.get('/tracks', :limit => amount, :order => 'hotness',
:duration => { :from => 1800000 })
tracks.each_with_index do | t, index |
duration = t.duration.to_f / 60 / 1000
printf "\n%3s.) %s - %.2f\n%5s %s\n", index + 1, t.title, duration, '-', t.permalink_url
end
puts
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment