Monday, May 23, 2011

Php Code: Last.Fm Artist Description function

I have created a small script which will take information about an artist from last fm. (how you manipulate this is up to you)

now im sure that my script probably isn't the best way of doing what it does, but it gets the job done. If anyone wants to add comments on how to make this better please go for it.

How it works.

1. Artist is taken from url (http://EXAMPLE.php?artist=...)
surely you can manipulate this to work however you want..

2. File_Get_Contets takes the information from (

3. str_pos is used to find the position of the text above and below where the artist description is.

4. str_replace is used to replace all of this text and all of the text before and after the artist description

5. all you are left with is you're artist description which is then simply echoed...

No comments:

Post a Comment