Communitay de Humptay
Lots of jibba jabba

Last.fm error

rated by 0 users
This post has 17 Replies | 1 Follower

Top 10 Contributor
Posts 10
The_Patient Posted: Thu, Sep 28 2006 1:53 PM

Hello again!

 
My scrobblersig is showing some weird message as you can see.

Could you fix that problem please? 

 

P.S.: I seriously think I'm the only one, who is using your great script. o_O
 

Top 25 Contributor
Posts 3
whoo replied on Fri, Sep 29 2006 4:37 AM

you are not the only one using it, trust me :) and I too would love a fix for the recent changes last.fm made. This is one of the nicer scripts available, 1 because it has a very small footprint, and 2 because it works.

 

awaiting your reply, Timothy and thanks in advance!

whoo

Top 10 Contributor
Posts 592
Humpty replied on Fri, Sep 29 2006 5:48 AM
Wow, people are still using ScrobblerSig, cool!  I'll try to get a fix out soon, thanks for mentioning this.
Top 10 Contributor
Posts 10

In scrobblersig.php change line 266

- from -

fp = @fopen("http://ws.audioscrobbler.com/txt/recent/$username", "r");

- to -

fp = @fopen("http://ws.audioscrobbler.com/1.0/user/$username/recenttracks.txt", "r");

Top 25 Contributor
Posts 3
whoo replied on Sat, Sep 30 2006 3:37 AM

thats not the only fix, nice try though.

 

Thanks for the prompt reply, Timothy, Ive subscrived to the thread so that I dont miss any updates.

Top 10 Contributor
Posts 592

I changed the url used in the script to pull the data.  The new file has a different format to it so I had to change other parts of the script to properly handle it.  I added a new variable called $currentlyPlayingCutoff which determines when the currently playing label should be used.  The new file doesn't make a provision for determining this like the other one did so I had to introduce this variable.

The attached script is versioned 3.0 because it includes changes that I was working on last year before my personal life got in the way.  The main change is that text can be word wrapped.  You'll have to specify a $maxWidth to see the effect.  For instance, try setting the max width to 100 and instead of the text just being cutoff the image will expand down to accomodate the word wrapped text.  Note, if you're using a background image the text will still be word wrapped but if the image isn't big enough to accommodate it then you won't see it expand all the way down.

Another change is that there is no longer a strict two line format, instead label variables will be used.  Similar to how you have <date> and <time> already there's now a <track> variable which you can see in the $currentlyPlayingLabel and $lastPlayedLabel labels.  You specify newlines with the \n newline character, similar to how most programming languages specify it.  Because there's no longer a two line system used anymore the $labelColor and $trackColor variables aren't used anymore; only the $foregroundColor is used now.  I was actually planning on introducing more variables other than <track>, one which would specify the color, so this wasn't going to be a problem when I made the change.

Since people are actually still using this script I'll go ahead and finish up what I started last year.  Since I'm returning to active development of this script let me know if there's anything else you'd like to see it do.

Top 10 Contributor
Posts 10
I can't download the attachment. But many thanks that you put so much effort in this amazing script :)
Top 10 Contributor
Posts 592
Humpty replied on Mon, Oct 2 2006 10:52 AM
Oops, sorry about that, guess I should've tested the attachment, huh. :)  It should work now.
Top 10 Contributor
Posts 10

No problem, I was afraid that you won't fix the problem today. ^^''

Thanks :D 

Top 25 Contributor
Posts 4

I'm using the 3.0 script right now, but no tracks are showing up.

 Sometimes, I get this error message:

 Warning: Wrong parameter count for imageftbbox() in /home/www/edgpal9.100webspace.net/scrobblersig.php on line 462

Warning: Wrong parameter count for imageftbbox() in /home/www/edgpal9.100webspace.net/scrobblersig.php on line 467

Warning: Wrong parameter count for imagefttext() in /home/www/edgpal9.100webspace.net/scrobblersig.php on line 524

Warning: Cannot modify header information - headers already sent by (output started at /home/www/edgpal9.100webspace.net/scrobblersig.php:462) in /home/www/edgpal9.100webspace.net/scrobblersig.php on line 542

Warning: Cannot modify header information - headers already sent by (output started at /home/www/edgpal9.100webspace.net/scrobblersig.php:462) in /home/www/edgpal9.100webspace.net/scrobblersig.php on line 547

Warning: Cannot modify header information - headers already sent by (output started at /home/www/edgpal9.100webspace.net/scrobblersig.php:462) in /home/www/edgpal9.100webspace.net/scrobblersig.php on line 548
ÿØÿà

 



Also, how can I make it so it shows 10 tracks? 

 

Edit: I think your script is great, because it actually works and it does what I want it to do. Thanks a lot! 

Top 10 Contributor
Posts 592
Humpty replied on Mon, Oct 2 2006 5:42 PM

Do you know which version of PHP your web host is using?  The script is made to work with PHP 4.3+.

At the moment the script only shows the most recently played track.  The improvements I mentioned in the post with the attachment include showing multiple tracks.  I'll periodically post script updates here.

Top 25 Contributor
Posts 4

I tried to find the version of PHP my host is using, but I cannot find it. Your old script (2.1) did work in the past before LastFM recently made their changes. In 3.0, the image shows up, but the tracks aren't showing.

 

In 2.1, I got these instructions to let it show 10 tracks:

And at the beginning of the script, where all the variables are, you just add this variable:

$numberOfTracks = 10;

Then, where the actual code is, you replace this:

//Check if a track is currently playing
if($trackData[0] != "") {
$track = $trackData[0];
$label = $currentlyPlayingLabel;
$date = time();
}
else {
$track = $trackData[1];
$label = $lastPlayedLabel;
$date = strtotime($trackData[2]);
}



by this:

if($numberOfTracks > 1) {
for ($t=1; $t<($numberOfTracks*2); $t=$t+2) {
$track = $track.$trackData[$t];
}
}
else {
$track = $trackData[1];
$label = $lastPlayedLabel;
$date = strtotime($trackData[2]);
}

 

Top 10 Contributor
Posts 592
Humpty replied on Mon, Oct 2 2006 8:20 PM

You're using the 3.0 script I posted above and still getting the error?  No modifications to it or anything?  I uploaded it to my web hoster and tested it out and it worked there, as well as on my testing machine.  If 2.1 worked for you then I'm kind of confused why this one wouldn't.  Make sure you delete your sig-username.txt file on the server when going from the 2.1 script to 3.0, since the file layout is different.  If nothing works can you PM me the script you're using, as well as tell me your last.fm username.

As for the number of tracks code, I'm taking a completely different approach with ScrobblerSig 3.0.  I don't really like vaporware so I won't go on and on about it but my intention is to make it a premier last.fm image generation script again.  Like I said earlier I'll be posting updates of it here.  It's not complete enough to warrant releasing on my site yet, doesn't justify updating the major version number.

Top 10 Contributor
Posts 592
Humpty replied on Tue, Oct 3 2006 8:29 PM
I had some trouble receiving your message.  I actually got the script but it was interspersed with the auto generated text the forum sends too so it was a big mess.  I tried to reconstruct it but still got errors.  If you really want to use 3.0 you can zip the php file you're using and send that to me, but I've updated the 2.x series to work with the new feed files, it's available from my home page: http://timothyhumphrey.name/scrobblersig/.
Top 25 Contributor
Posts 4

Here is my Zip file with my 3.0 PHP script:

http://download.yousendit.com/DF746C1A03565F66

 I tried the 2.2, but the image was messed up somehow. Some black parts of my image and black parts of the text were showing as white.
 

 

 

Page 1 of 2 (18 items) 1 2 Next > | RSS
Powered by Community Server (Non-Commercial Edition), by Telligent Systems