The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Songkick - Perl wrapper for the Songkick API

SYNOPSIS

  use Net::Songkick;

  my $api_key = 'your_api_key';
  my $sk = Net::Songkick->new({ api_key => $api_key });

  # Returns XML by default
  my $events = $sk->get_events;

  # Or returns JSON
  my $events = $sk->get_events({ format => 'json' });

DESCRIPTION

This module presents a Perl wrapper around the Songkick API.

Songkick (https://www.songkick.com/) is a web site that tracks gigs around the world. Users can add information about gigs (both in the past and the future) and can track their attendance at those gigs.

For more details of the Songkick API see https://www.songkick.com/developer.

METHODS

Net::Songkick->new({ api_key => $api_key })

Creates a new object which can be used to request data from the Songkick API. Requires one parameter which is the user's API key.

To request an API key from Songkick, see https://www.songkick.com/api_key_requests/new.

Returns a Net::Songkick object if successful.

$sk->return_perl

Returns a Boolean value indicating whether or not this Net::Songkick object should return Perl data structures for requests.

$sk->parse_events_from_json($json_text)

Takes the JSON returns by a request for a list of events, parses the JSON and returns a list of Net::Songkick::JSON objects.

$sk->get_events({ ... options ... });

Gets a list of upcoming events from Songkick. Various parameters to control the events returned are supported for the full list see http://www.songkick.com/developer/event-search.

In addition, this method takes an extra parameter, format, which control the format of the data returned. This can be either xml, json or perl. If it is either xml or json then the method will return the raw XML or JSON from the Songkick API. If it is perl then this method will return a list of Net::Songkick::Event objects. If this parameter is omitted, then perl is assumed.

$sk->get_upcoming_events({ ... options ... });

Gets a list of upcoming events for a particular user from Songkick. This method accepts all of the same search parameters as get_events. It also supports the optional format parameter.

This method has another, mandatory, parameter called user. This is the username of the user that you want information about.

$sk->get_past_events({ ... options ... });

Gets a list of upcoming events for a particular user from Songkick.

This method has an optional parameter, page to control which page of the data you want to return. It also supports the format parameter.

This method has another, mandatory, parameter called user. This is the username of the user that you want information about.

$sk->get_venue_events({ ... options ...});

$sk->get_artist_events({ ... options ... });

$sk->get_metro_events({ ... options ... });

AUTHOR

Dave Cross <dave@perlhacks.com>

SEE ALSO

perl(1), http://www.songkick.com/, http://developer.songkick.com/

COPYRIGHT AND LICENSE

Copyright (C) 2010, Magnum Solutions Ltd. All Rights Reserved.

This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.