App::ygeo - Extract companies data from Yandex Maps to csv file
version 0.02
use App::ygeo; my $ygeo = App::ygeo->new( apikey => '12345', city => "ROV" ); $ygeo->get_and_print(text => 'autoservice', city => 'ROV', csv_filename => 'auto.csv', verbose => 1);
By default it:
get data about maximum 500 companies (Yandex API restriction)
Order of looking for apikey
- provided params
- .ygeo file (firsty it search .ygeo file in current directory, then in home directory)
.ygeo
.ygeo config has yaml syntax. You can reuse App::ygeo::yaml in your own projects
$ygeo->get_and_print(text => 'autoservice', city => 'ROV', csv_filename => 'auto.csv', verbose => 1);
Get and prints data in csv data
Params:
text - search text
city - city to search, e.g. ROV is Rostov-on-Don
csv_filename - name of output csv file
results_limit -number of results returned
Columns sequence is according "to_array" in Yandex::Geo::Company method
Results are printed to csv like
my $res = $yndx_geo->y_companies( $text ); for my $company (@$res) { $csv->print( $fh, $company->to_array ); }
Return 1 if finished fine
Pavel Serikov <pavelsr@cpan.org>
This software is copyright (c) 2018 by Pavel Serikov.
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 App::ygeo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::ygeo
CPAN shell
perl -MCPAN -e shell install App::ygeo
For more information on module installation, please visit the detailed CPAN module installation guide.