Sha256: c0a2b811d234e3f06964d6cda4eb619f93fe3c51d24fcd37c64741c2e178c0a6

Contents?: true

Size: 627 Bytes

Versions: 14

Compression:

Stored size: 627 Bytes

Contents

class Caboodle::Lastfm < Caboodle::Kit
  description "Displays your recent and all time top Last.fm plays"
  
  required [:lastfm_username]
  
  menu "Listening" do
    scrape = Caboodle.scrape("http://www.last.fm/user/#{Caboodle::Site.lastfm_username}")
    @recent = scrape.css("#recentTracks .module-body").to_html
    @recent.gsub!("href=\"/", 'href="http://last.fm/')
    @top = scrape.css(".modulechartsartists .module-body").to_html
    @top.gsub!("href=\"/", 'href="http://last.fm/')
    
    haml :listening
  end
  
  credit "http://www.last.fm/listen/user/#{lastfm_username}", "#{lastfm_username} on Last.fm"
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
caboodle-0.3.0 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.30 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.29 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.28 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.27 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.26 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.25 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.24 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.23 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.22 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.21 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.20 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.19 lib/caboodle/kits/lastfm/lastfm.rb
caboodle-0.2.18 lib/caboodle/kits/lastfm/lastfm.rb