WebService::Yes24 - Yes24 Web Service API Module
version 0.100980
use 5.010; use WebService::Yes24; my $yes24 = WebService::Yes24->new; $yes24->search( "Learning Perl" ); for my $item ( @{ $yes24->result } ) { say $item->{title}; say $item->{cover}; say $item->{author}; say $item->{publisher}; say $item->{date}; say $item->{price}; say $item->{mileage}; say $item->{link}; } my $total = $yes24->search( "Learning Perl" ); my $last_page = ($total / $yes24->page_size) + 1; for my $page ( 1 .. $last_page ) { for my $result ( @{ $yes24->result($page) } ) { say $item->{title}; say $item->{cover}; say $item->{author}; say $item->{publisher}; say $item->{date}; say $item->{price}; say $item->{mileage}; say $item->{link}; } }
Yes24 (http://www.yes24.com) is a e-commerce company in South Korea. They mainly sell books, CD/DVDs, gifts and etc like Amazon. This module provides APIs to get information from Yes24.
In fact, Yes24 doesn't support API. So, implementation of this module is based on the web scraping, which is the very fragile approach and very slow. Please remember, one day this module might not work! If you find the such situation, let me know. :-)
This attribute stores the category. The available categories are "all", "korean-book" and "foreign-book". The default value is "all".
This attribute stores the page size. The available page sizes are 20, 40 and 60. The default value is 20.
This attribute stores the page number. The minimum page number is 1. The default value is 1.
This attribute stores the sort type. The available sort types are listed below:
- accuracy - sales - date - recommendation - review - score - coupon - low-price - high-price - event - gift
The default values is 'accuracy'.
This attribute stores the boolean value of the availability of sold out products. If this value is set, search result contains the sold out products. The default value is true.
This attribute stores the query type. The available query types are listed below:
- normal - author - publisher - keyword - isbn
The default value is 'normal'.
my $yes24 = WebService::Yes24->new;
This method will create and return WebService::Yes24 object.
If any parameter was not given, the default values are used:
# Same as the above code my $yes24 = WebService::Yes24->new( category => 'all', page_size => 20, page => 1, sort => 'accuracy', sold_out => 1, query_type => 'normal', );
my $total = $yes24->search('Learning Perl');
This method will start search from Yes24. You have to specify the search keyword as the parameter. It returns total items of the search result.
my @items = @{ $yes24->result };
This method will return the items of the search result.
You can set the page number.
my $page_number = 2; my @items_2 = @{ $yes24->result($page_number) };
If the page number is omitted, then $self->page is used. Above code is same as below:
my $page_number = 2; $yes24->page($page_number); my @items_2 = @{ $yes24->result };
Keedi Kim - 김도형 <keedi at cpan.org>
This software is copyright (c) 2010 by Keedi Kim.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WebService::Yes24, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Yes24
CPAN shell
perl -MCPAN -e shell install WebService::Yes24
For more information on module installation, please visit the detailed CPAN module installation guide.