Skip to content

Instantly share code, notes, and snippets.

@Akron
Created June 2, 2012 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akron/2858214 to your computer and use it in GitHub Desktop.
Save Akron/2858214 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use Mojo;
my $ua = Mojo::UserAgent->new;
$ua->max_redirects(5);
my $base_url ='http://api.powerhousemuseum.com/api/v1/category/xml/';
my $api_key = 'xxx';
my $base_rest_url = Mojo::URL->new($base_url)->query({ api_key => $api_key});
my @names = $ua->get($base_rest_url)->res->dom->find('name')
->map(sub { $_->text })->each;
print join ',', @names;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment