Created
April 23, 2011 01:12
-
-
Save jherskowitz/938086 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.url.indexOf("pitchfork.com/forkcast") != -1) | |
{ | |
Playgrub.source.url = 'http://pitchfork\.com.*/forkcast.*'; | |
Playgrub.source.error = 'Tomahawk currently supports the Track Reviews & Forkcast pages only. Please check your url.'; | |
Playgrub.source.scrape = function() { | |
$("h1.title").each(function () { | |
var song_result = $($(this).children('a')[1]).text(); | |
song_result = song_result.replace('"', ''); | |
var artist = $($(this).children('a')[0]).text(); | |
Playgrub.playlist.add_track(artist, song_result); | |
}); | |
} | |
Playgrub.source.start(); | |
} else if | |
Playgrub.source.url = 'http://pitchfork\.com/reviews/tracks'; | |
Playgrub.source.error = 'Tomahawk currently supports the Track Reviews and Best New Tracks page only. Please check your url.'; | |
Playgrub.source.scrape = function() { | |
$("h2.tombstone").each(function () { | |
var song_result = $($(this).children('a')[1]).text(); | |
song_result = song_result.substring(1, song_result.length-1); | |
var artist = $($(this).children('a')[0]).text(); | |
Playgrub.playlist.add_track(artist, song_result); | |
}); | |
} | |
Playgrub.source.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment