From a67a9d3f19e34e0eb3e7df9c38bfc60a6c06e80d Mon Sep 17 00:00:00 2001 From: Matt Katz Date: Sun, 16 Jan 2011 14:14:54 -0500 Subject: [PATCH 1/4] move lastfm user and key to config.php --- config.php | 5 ++++- heardsync.php | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config.php b/config.php index 8302415..43f9e04 100644 --- a/config.php +++ b/config.php @@ -17,8 +17,11 @@ define('DB_PASS', "YOUR_DATABASE_PASSWORD"); // DB table names - define('DB_TABLE', "tracks"); +//your last.fm info +define('API_KEY', "YOUR_LASTFM_API_KEY"); +define('LASTFM_USER', "YOUR_LASTFM_USER"); + ?> diff --git a/heardsync.php b/heardsync.php index d4f87f7..0fc335e 100644 --- a/heardsync.php +++ b/heardsync.php @@ -23,8 +23,7 @@ // for now, we'll just run this 2 times per day, so if you listen to more than 200 songs in 12 hours, we will miss some... // at one point I knew the right way to do it but I didn't implement it, so feel free to figure it out... -$from_xml_source = 'http://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&api_key=xxxxxxxxxxxxxxxxxxxxxxxx&user=xxxxxxxxxxxx&limit=100&page=1'; -// ...................................................................................... ^ PUT YOUR API KEY HERE ^ PUT YOUR USERNAME HERE +$from_xml_source = 'http://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&api_key='.API_KEY.'user='.LASTFM_USER.'&limit=100&page=1'; $from_remote_fp = fopen($from_xml_source, "rb"); From 0cf1662c4c30d3c01210201f9e4f550b090f9083 Mon Sep 17 00:00:00 2001 From: Matt Katz Date: Sun, 16 Jan 2011 14:17:16 -0500 Subject: [PATCH 2/4] echo the lastfm user so tracks is dynamic --- tracks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracks.php b/tracks.php index d334c72..a957ed7 100644 --- a/tracks.php +++ b/tracks.php @@ -130,7 +130,7 @@

Heard

-

visit rasterweb on Last.fm

+

visit on Last.fm

tracks scrobbled. From 470a91b5f328fde833980171e6b96f0c4a45769a Mon Sep 17 00:00:00 2001 From: Matt Katz Date: Sun, 16 Jan 2011 14:21:07 -0500 Subject: [PATCH 3/4] fix the spacing --- tracks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracks.php b/tracks.php index a957ed7..8862dc7 100644 --- a/tracks.php +++ b/tracks.php @@ -130,7 +130,7 @@

Heard

-

visit on Last.fm

+

visit on Last.fm

tracks scrobbled. From bb78ad71e9a9107eae8dff333d406ff01c406b9d Mon Sep 17 00:00:00 2001 From: Matt Katz Date: Tue, 18 Jan 2011 20:40:29 -0500 Subject: [PATCH 4/4] missing ampersand in the URL --- heardsync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heardsync.php b/heardsync.php index 0fc335e..4851b74 100644 --- a/heardsync.php +++ b/heardsync.php @@ -23,7 +23,7 @@ // for now, we'll just run this 2 times per day, so if you listen to more than 200 songs in 12 hours, we will miss some... // at one point I knew the right way to do it but I didn't implement it, so feel free to figure it out... -$from_xml_source = 'http://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&api_key='.API_KEY.'user='.LASTFM_USER.'&limit=100&page=1'; +$from_xml_source = 'http://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&api_key='.API_KEY.'&user='.LASTFM_USER.'&limit=100&page=1'; $from_remote_fp = fopen($from_xml_source, "rb");