Skip to content

Instantly share code, notes, and snippets.

dgw dgw

Block or report user

Report or block dgw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dgw
dgw / lastfm.php
Last active Aug 29, 2015 — forked from dewey/lastfm.php
Forked from dewey and changed to display "last listened to" if the latest track in the feed is not currently playing.
View lastfm.php
#!/usr/bin/php
<?php
$doc = new DOMDocument();
$doc->load("http://ws.audioscrobbler.com/2.0/user/voyagerfan5761/recenttracks.xml?limit=1");
$arrFeeds = array();
foreach ($doc->getElementsByTagName('track') as $node) {
$itemRSS = array (
'artist' => $node->getElementsByTagName('artist')->item(0)->nodeValue,
'name' => $node->getElementsByTagName('name')->item(0)->nodeValue,
'nowplaying' => ($node->attributes->getNamedItem('nowplaying')) ? true : false
You can’t perform that action at this time.