Skip to content

Commit

Permalink
Import of MIOREL/WWW-Grooveshark-0.02 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: WWW-Grooveshark
gitpan-cpan-version:      0.02
gitpan-cpan-path:         MIOREL/WWW-Grooveshark-0.02.tar.gz
gitpan-cpan-author:       MIOREL
gitpan-cpan-maturity:     released
  • Loading branch information
miorel authored and Gitpan committed Oct 25, 2014
1 parent ab68e09 commit 078b126
Show file tree
Hide file tree
Showing 11 changed files with 387 additions and 174 deletions.
29 changes: 29 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
Revision history for WWW::Grooveshark
=====================================

July 22, 2009
-------------
* added tests and documentation for the tinysong API methods
* releasing version 0.02

July 21, 2009
-------------
* added one more user API method and tests

July 19, 2009
-------------
* added example script to query the service for a list of its API methods and
their parameters
* minor documentation updates

July 10, 2009
-------------
* added "query_string" as a constructor option
* WWW::Grooveshark destructor now destroys the session, if any
* overloaded boolean evaluation of WWW::Grooveshark::Response objects to give
true for success responses and false for fault responses
* wrapped two more service API methods

July 8, 2009
------------
* some documentation fixes
* added "staging" as a constructor option to use the staging server instead
of the live one by default

July 7, 2009
------------
* improved documentation significantly
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ META.yml Module meta-data
Makefile.PL Generate Makefile
README Useful information
examples/beatles.pl (Modified) example from SYNOPSIS
test_config.example Example of test configuration
examples/methods.pl List the API methods and parameters
test_config.example Example test configuration
lib/WWW/Grooveshark.pm Source for WWW::Grooveshark
lib/WWW/Grooveshark/Response.pm Source for WWW::Grooveshark::Response
t/WWW-Grooveshark.t Test WWW::Grooveshark
Expand Down
4 changes: 3 additions & 1 deletion META.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: WWW-Grooveshark
version: 0.01
version: 0.02
abstract: Perl wrapper for the Grooveshark API
author:
- Miorel-Lucian Palii <mlpalii@gmail.com>
Expand All @@ -18,7 +18,9 @@ requires:
LWP::UserAgent: 0
NEXT: 0.61
perl: 5.006
URI::Escape: 0
resources:
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Grooveshark
repository: http://elementsofpuzzle.googlecode.com/
no_index:
directory:
Expand Down
2 changes: 2 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WriteMakefile(
LICENSE => 'perl',
META_MERGE => {resources =>
{
bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Grooveshark',
repository => 'http://elementsofpuzzle.googlecode.com/',
}},
MIN_PERL_VERSION => '5.006',
Expand All @@ -19,5 +20,6 @@ WriteMakefile(
JSON::Any => 0,
LWP::UserAgent => 0,
NEXT => 0.61,
URI::Escape => 0,
},
);
14 changes: 12 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
WWW::Grooveshark version 0.01
WWW::Grooveshark version 0.02
=============================

Some module is a very interesting piece of software.
Grooveshark is an internationally-available online music search, streaming,
and recommendation service. WWW::Grooveshark wraps this service's API in
an object-oriented Perl interface, allowing you to programmatically search
for songs, artists, albums, or playlists; browse popular music; get song
recommendations; manage playlists; and more.

This version wraps a few more API methods, fixes some documentation errors,
and increases laziness potential: response objects can be used as booleans
to check if an API call was successful and WWW::Grooveshark objects will
end their session, if any, when garbage collected.

INSTALLATION

Expand Down Expand Up @@ -38,6 +47,7 @@ This module requires the following other modules:
JSON::Any
LWP::UserAgent
NEXT (at least version 0.61)
URI::Escape

CONTACT

Expand Down
14 changes: 6 additions & 8 deletions examples/beatles.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@

use WWW::Grooveshark;

# modify the following line to try this example
my $api_key = 'deadbeef';
# specify an API key to try this example or pass in on the command line
my $api_key = shift || 'deadbeef';

my $gs = WWW::Grooveshark->new;

my $r = $gs->session_start(apiKey => $api_key);
if($r->is_fault) {
my $r;
$r = $gs->session_start(apiKey => $api_key) or do {
printf STDERR "ERROR: " . $r->fault_line;
exit(1);
}
};

for($gs->search_songs(query => "The Beatles", limit => 10)->songs) {
printf("%s", $_->{songName});
printf(" by %s", $_->{artistName});
printf(" on %s", $_->{albumName});
printf(" <%s>\n", $_->{liteUrl});
}

$gs->session_destroy;

24 changes: 24 additions & 0 deletions examples/methods.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/perl

use warnings;
use strict;

use WWW::Grooveshark;

# specify an API key to try this example or pass in on the command line
my $api_key = shift || 'deadbeef';

my $gs = WWW::Grooveshark->new;

my $r;
$r = $gs->session_start(apiKey => $api_key) or do {
printf STDERR "ERROR: " . $r->fault_line;
exit(1);
};

my @methods = $gs->service_getMethods->methods;
for(sort {$a->{method} cmp $b->{method}} @methods) {
my $method_name = $_->{method};
my @parameters = @{$_->{parameters}};
printf("%s(%s)\n", $method_name, join(", ", @parameters));
}
Loading

0 comments on commit 078b126

Please sign in to comment.