VUser:...::V2_0(3pm)
π VUser:...::V2_0 π
okay bestie, welcome to VUser:...::V2_0, aka VUser::Google::ApiProtocol::V2_0 β it's a user-contributed Perl thing (manual section 3pm, the Perl module pages, iykyk) and it's literally just... version 2.0 of the Google APIs, implemented. that's the whole vibe. β¨
πΈ NAME πΈ
VUser::Google::ApiProtocol::V2_0 β bestie, this module Implements version 2.0 of the Google APIs. no cap, that's it, that's the job. π
π SYSNOPSIS π
here's how you actually use it, copied exactly so you can just paste and go:
use VUser::Google::ApiProtocol::V2_0;
## Create a new connection
my $google = VUser::Google::ApiProtocol::V2_0->new(
domain => 'your.google-apps-domain.com',
admin => 'admin_user',
password => 'admin_user password',
);
## Login to the Google Apps API
# Login() uses the credentials provided in new()
$google->Login();
## Create a new request
# Create the URL to send to API request to.
# See the API docs for the valid URLs
my $url = "https://apps-apis.google.com/a/feeds/emailsettings/2.0/"
$url .= "your.google-apps-domain.com/username/label";
# Create XML message to send to Google
# See the API docs for the valid XML to send
my $xml = '<?xml version="1.0" encoding="utf-8"?>...';
# NB: The method (POST here) may be different depending on API call
my $success = $google->Request('POST', $url, $xml);
# Get the parsed response
if ($success) {
# $result is the XML reply parsed by XML::Simple
my $result = $google->get_result;
}
else {
# $result is the error message from google
# parsed by XML::Simple with the addition of a
# 'reason' key which contains the error.
my $result = $google->get_result;
die "Error: $result->{reason}";
}
so real talk about what's happening up there π«Ά:
- you spin up a new connection with
new(), passing yourdomain, youradmin, and yourpassword. - then
Login()logs you in β and heads up, it uses the credentials you already handed tonew(). - then you build your
$url, build your$xml, and fire it off withRequest(). the HTTP method (it'sPOSTin the example) can be different depending on which API call you're making, so check the docs. - if it worked,
get_resultgives you the XML reply parsed byXML::Simple. if it flopped, you still get a result β the error message from google, also parsed byXML::Simple, except with an extra'reason'key holding the error. that's the one youdieon. π
β¨ DESCRIPTION β¨
so like. this module Implements version 2.0 of the Google API. and for the full rundown of members and methods, you're gonna wanna go look at VUser::Google::ApiProtocol β that's where the whole list lives. periodt. π
π¦ SEE ALSO π¦
VUser::Google::ApiProtocolXML::Simple
π AUTHOR π
Randy Smith <perlstalker@vuser.org>
Adapted from code from Johan Reinalda <johan@reinalda.net>
π LICENSE π
Copyright (C) 2006 by Johan Reinalda, johan at reinalda dot net
Copyright (C) 2009 by Randy Smith, perlstalker at vuser dot org
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
If you make useful modification, kindly consider emailing then to me for inclusion in a future version of this module.
π if you make useful modification, kindly consider emailing then to me for inclusion in a future version of this module β that's literally the original asking, bestie, go be a main character and send it in.
and that's a wrap! this page ships as perl v5.32.0, dated 2021-01-09 β the version and the date are right there, frozen in time like a screenshot from 2021. slay. πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libvuser-google-api-perl 1.0.1-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libvuser-google-api-perl 1.0.1-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libvuser-google-api-perl 1.0.1-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libvuser-google-api-perl 1.0.1-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms