DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile Favorite Artists For Social Network

  • submit to reddit
        // Returns a list of your top 50 favorite artists from, suitable for pasting into a Facebook, Myspace, or similar profile

#!/usr/bin/env ruby
require 'net/http'
require 'csv'
user = 'nertzy'
csv = Net::HTTP.get '', "/1.0/user/#{user}/topartists.txt"
puts CSV::Reader.parse(csv).collect{ |row| row[2] }.join(", ")


Snippets Manager replied on Fri, 2007/06/22 - 5:52am

Hi, I am new to ruby and am wondering how to get this code working on a MySpace profile successfully? Thanks.