Yandex::Audience - a simple API for Yandex.Audience
It contains very few number of API-calls now.
version 0.01
use Yandex::Audience; my $Token = 'AgAAAAAAELGSBIXHdBAPDm-6sJ7Sbao7J-pmaU7'; #Auth token my $YaAudience= Yandex::Audience->new( -token => $Token); #Get list of existing segments my $Segments = $YaAudience->getListOfSegments(); #Upload a content of String in CSV-fromat my $Segment = $YaAudience->uploadCSV($CSV); #Upload CSV-file my $Segment = $YaAudience->uploadCSV('real1500_md5.csv'); #Save the uploaded content as a segment my $SegmentStatus = $YaAudience->saveSegment( segment => $Segment->{id}, name => 'Litres'.$Segment->{id}, hashed => 1, ) if exists $Segment->{id}; #Delete a segment my $Result = $YaAudience->deleteSegment(9243581);
Returns a list of existing segments available to the user.
my $Segments = $YaAudience->get_list_of_segments();
Upload a CSV-file with data and create a segment. Returns Hash with Id of segment(s) and it's statuses.
my $Segment = $YaAudience->uploadCSV('real1500_md5.csv');
Saves a segment generated from a file with user data.
my $SegmentStatus = $YaAudience->saveSegment( -segment => $Segment->{id}, #Id of a segment -name => 'Litres'.$Segment->{id}, #A name of a segment -hashed => 1, #1 if data contains hashed fields ) if exists $Segment->{id};
Deletes the specified segment (or segments) Returns arrayref to scalars: 1 if success, 0 otherwise.
my $Result = $YaAudience->deleteSegment($SegmentID); #$SegmentID - can be scalar or arrayref to scalars, or arrayref to hashes with id of segment(s). or my $Result = $YaAudience->deleteSegment( [9254200, 9254215] );
The internal method. Deletes a segment. Returns scalar: 1 if success, 0 otherwise.
my $Result = $YaAudience->_deleteSegment($SegmentID); #$SegmentID - scalar, contains id of segment.
The internal method. Returns hash with values of type JSON::Boolean changed to Scalars (1 and 0).
Dmitry Marin, <mcorvax at cpan.org>
<mcorvax at cpan.org>
Please report any bugs or feature requests to bug-yandex-audience at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Yandex-Audience. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-yandex-audience at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Yandex::Audience
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Yandex-Audience
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Yandex-Audience
CPAN Ratings
https://cpanratings.perl.org/d/Yandex-Audience
Search CPAN
https://metacpan.org/release/Yandex-Audience
This software is Copyright (c) 2019 by Dmitry Marin.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Yandex::Audience, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yandex::Audience
CPAN shell
perl -MCPAN -e shell install Yandex::Audience
For more information on module installation, please visit the detailed CPAN module installation guide.