We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit c46ae9b2 authored by mattl's avatar mattl

added link to client codes page, and updated lastscrape to dump its output to screen

parent 5002c0b8
......@@ -34,7 +34,7 @@ def parse_track(row):
return (None, None, None)
def fetch_tracks(user, request_delay=0.5):
def fetch_tracks(user, request_delay=2):
"""Fetch all tracks from a profile page and return a list."""
url = 'http://last.fm/user/%s/tracks' % user
soup = BeautifulSoup(urllib2.urlopen(url))
......@@ -60,6 +60,7 @@ def main(*args):
f = codecs.open(args[2], 'w', 'utf-8')
for artist, track, timestamp in fetch_tracks(args[1]):
f.write(u'%s\t%s\t%s\n' % (artist, track, timestamp))
print u'%s\t%s\t%s' % (artist, track, timestamp)
f.close()
else:
print __doc__
......
......@@ -176,7 +176,7 @@ class Server {
$row = sanitize($i);
// this logic should be cleaned up and the free/nonfree decision be moved into the smarty templates
if($row["name"] == "") {
$clientstr = strip_tags(stripslashes($row["client"])) . " (unknown, please tell us what this is)";
$clientstr = strip_tags(stripslashes($row["client"])) . " (unknown, <a href=\"http://ideas.libre.fm/index.php/Client_Codes\">please tell us what this is</a>)";
} elseif($row["free"] == "Y") {
$clientstr = "<a href=\"" . strip_tags(stripslashes($row["url"])) . "\">" . strip_tags(stripslashes($row["name"])) . "</a>";
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment