
i used to be NintendoNews. visit my blog or add me on twitter.
need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!
"I am the way, the truth, and the life. No one comes to the Father except through me"
John 14:6 (NIV)
Yeah i just said it for no reason...
Or maybe to help other people who want to do this? Maybe
“two players, two sides.
one is light, one is dark.”
- John Locke
Thanks you two +REP
Im leaning alot more about exploding things this way and more ways I can use it in my programs.
Kevin
Yeah I only learnt about properly using explode when coding habbo imager stuff. I understand it alot now.
“two players, two sides.
one is light, one is dark.”
- John Locke
Im starting to learn how to search through divs etc thanks to you thomas
I learned GD through the imager things too.. and now im pretty dang good at it![]()
I've made it easier now, this function is for anyone who needs it. To use it just save it as albumart.php and then put the following into your page:
By the way, it explodes it for you, so just put it directly from your shoutcast stats script. Here is albumart.php:PHP Code:<?php
include("albumart.php");
getAlbumArt($current_playing_song);
?>
PHP Code:<?php
function getAlbumArt($now_playing) {
$artist_name = explode(" - ", $now_playing);
$artist_name = str_replace(" ", "+", $artist_name);
$url_to_query = "http://www.last.fm/music/" . $artist_name . "/";
$query = file_get_contents($url_to_query);
$album_art_start = explode('<div class="imgHolder">', $query);
$album_art_end = explode('</div>', $album_art_start[1]);
$album_art_html = trim($album_art_end[0]);
$image_url_start = explode('<img src="', $album_art_html);
$image_url_end = explode('" alt', $image_url_start[1]);
$image_url = trim($image_url_end[0]);
echo '<img src="' . $image_url . '" alt="' . $artist_name . '">';
}
?>
Last edited by timROGERS; 16-02-2007 at 05:25 PM.
i used to be NintendoNews. visit my blog or add me on twitter.
need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!
"I am the way, the truth, and the life. No one comes to the Father except through me"
John 14:6 (NIV)
Nice little script +rep (dunno if my power will affect it)
“two players, two sides.
one is light, one is dark.”
- John Locke
Nice script. I cant +rep again but I will soon
Your better at functions and classes then I am![]()
But if they dont want it to echo it out you could edit it to:
Then you would putPHP Code:<?php
function getAlbumArt($now_playing) {
$artist_name = explode(" - ", $now_playing);
$artist_name = str_replace(" ", "+", $artist_name);
$url_to_query = "http://www.last.fm/music/" . $artist_name . "/";
$query = file_get_contents($url_to_query);
$album_art_start = explode('<div class="imgHolder">', $query);
$album_art_end = explode('</div>', $album_art_start[1]);
$album_art_html = trim($album_art_end[0]);
$image_url_start = explode('<img src="', $album_art_html);
$image_url_end = explode('" alt', $image_url_start[1]);
$image_url = trim($image_url_end[0]);
return $image_url;
}
?>
PHP Code:<?php
include('albumart.php');
$album = getAlbumArt("Artist Name - Song Name");
//Then you could echo it out whenever you wanted
echo '<img src="'.$album.'">';
//Or you could use it with GD etc
?>
“two players, two sides.
one is light, one is dark.”
- John Locke
Nice implementation Thomas![]()
i used to be NintendoNews. visit my blog or add me on twitter.
need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!
"I am the way, the truth, and the life. No one comes to the Father except through me"
John 14:6 (NIV)
Want to hide these adverts? Register an account for free!