WebService::DMM - DMM webservice module
use WebService::DMM; use Config::Pit; my $config = pit_get('dmm.co.jp', require => { affiliate_id => 'DMM affiliate ID', api_id => 'DMM API ID', }); my $dmm = WebService::DMM->new( affiliate_id => $config->{affiliate_id}, api_id => $config->{api_id}, ); my $response = $dmm->search( %params ); die "Failed to request" unless $response->is_success; for my $item (@{$response->items}) { .... }
WebService::DMM is DMM webservice module. DMMhttp://www.dmm.com is Japanese shopping site.
WebService::DMM->new(%args) :WebService::DMM
Create and return a new WebService::DMM instance with %args.
%args must have following parameter:
Affiliate ID of DMM. Postfix of affliate_id should be 900-999.
API ID of DMM. Register your account in DMM and you can get API ID.
%params mandatory parameters are:
Version should be '1.00' or '2.00'.
Time format should be 'Year-Month-Day Hour:Minute:Second' (strftime format is '%Y-%m-%d %T')
Site, 'DMM.co.jp' or 'DMM.com'.
%param optional parameters are:
Number of items
Offset of searched results
Type of sort, 'rank', '+price', '-price', 'date', 'review'.
See "SERVICE AND FLOOR" section
Search keyword. You can use DMM search keyword style. Keyword should be string(not byte sequence).
Return last response which is a Furl::Response instance.
DMM.com services are:
akb48, ske48
bandai, anime, video, idol, cinema, fight
toei, animate, shochikugeino, idol, cinepara, dgc, fleague
comic, novel, photo, otherbooks
pcgame, pcsoft
dvd, cd, book, game, hobby, kaden, houseware, gourmet
rental_dvd, ppr_dvd, rental_cd, ppr_cd, comic
fashion_ladies, fashion_mems, rental_iroiro
DMM.co.jp services are:
videoa, videoc, nikkatsu, anime, photo
shirouto, nikkatsu, paradisetv, animech, dream, avstation, playgirl, alice, crystal, hmp, waap, momotarobb, moodyz, prestige, jukujo, sod, mania, s1, kmp, mousouzoku
video, videoc
pcgame
doujin
book
dvd, good, anime, pcgame, book, doujin
rental_dvd, ppr_dvd
You can specify your own instance of Furl to set $WebService::DMM::UserAgent.
$WebService::DMM::UserAgent = Furl->new( your_own_paramter );
There are many examples in the "eg/" directory in this distribution.
Syohei YOSHIDA <syohex@gmail.com>
Copyright 2013 - Syohei YOSHIDA
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Official Guide https://affiliate.dmm.com/api/guide/
To install WebService::DMM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::DMM
CPAN shell
perl -MCPAN -e shell install WebService::DMM
For more information on module installation, please visit the detailed CPAN module installation guide.