#! /usr/bin/perl

use strict;
use warnings;
use XML::DOM;

local $/ = undef;
my $content = <>;

my $parser = XML::DOM::Parser->new;
my $doc = $parser->parse($content);
my $tracks = $doc->getElementsByTagName("track");
if ($tracks->getLength == 0) {
	print "Didn't recognize song\n";
	exit;
}
my $track = $tracks->item(0);
my $title = $track->getElementsByTagName("ttitle")->item(0)->getFirstChild->getData;
my $artist = $track->getElementsByTagName("tartist")->item(0)->getFirstChild->getData;

print "$title,$artist\n";
