Skip to content

Instantly share code, notes, and snippets.

@larsen
Created April 8, 2012 13:44
Show Gist options
  • Save larsen/2337396 to your computer and use it in GitHub Desktop.
Save larsen/2337396 to your computer and use it in GitHub Desktop.
a snippet from Net::MusixMatch implementation
sub get_track {
my $self = shift;
my %params = @_;
return unless $params{ track_id }
|| $params{ track_mbid }
|| $params{ track_echonest_id };
my $result = $self->_call_api( 'track.get', %params );
my $track = Net::MusixMatch::Track->new(
$result->{ message }->{ body }->{ track }
);
return $track;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment