-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
68 lines (51 loc) · 1.85 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
NAME
Net::LastFM - A simple interface to the Last.fm API
SYNOPSIS
my $lastfm = Net::LastFM->new(
api_key => 'XXX',
api_secret => 'YYY',
json => 0,
);
my $data = $lastfm->request_signed(
method => 'user.getRecentTracks',
user => 'lglb',
);
DESCRIPTION
The module provides a simple interface to the Last.fm API. To use this
module, you must first sign up at <http://www.last.fm/api> to receive an
API key and secret.
You can then make requests on the API - most of the requests are signed.
You pass in a hash of paramters and a data structure mirroring the
response is returned.
Raw JSON data will be returned if you set the json flag true.
This module confesses if there is an error.
METHODS
request
This makes an unsigned request:
my $data = $lastfm->request( method => 'auth.gettoken' );
request_signed
This makes a signed request:
my $data = $lastfm->request_signed(
method => 'user.getRecentTracks',
user => 'lglb',
);
create_http_request
If you want to integrate this module into another HTTP framework, this
method will simple create an unsigned HTTP::Request object:
my $http_request = $lastfm->create_http_request(
method => 'auth.gettoken'
);
create_http_request_signed
If you want to integrate this module into another HTTP framework, this
method will simple create a signed HTTP::Request object:
my $http_request = $lastfm->create_http_request_signed(
method => 'user.getRecentTracks',
user => 'lglb',
);
AUTHOR
Leon Brocard <[email protected]>
COPYRIGHT
Copyright (C) 2008-9, Leon Brocard.
LICENSE
This module is free software; you can redistribute it or modify it under
the same terms as Perl itself.