Net::U...esponse(3pm)
π Net::UPnP::ActionResponse β the manual page bestie edition π
okay so. you're holding the docs for Net::UPnP::ActionResponse (it's a 3pm Perl manual page, from the User Contributed Perl Documentation collection, if you were wondering why it's giving very "community-made and proud of it"). It's a Perl extension for UPnP. that's it, that's the whole premise. let's get into it π«Ά
β¨ NAME β¨
Net::UPnP::ActionResponse β Perl extension for UPnP. that's the name, that's the gig, no notes π
πΈ SYNOPSIS πΈ
here's the whole vibe in code, bestie. copy it, run it, love it:
use Net::UPnP::ControlPoint;
my $obj = Net::UPnP::ControlPoint->new();
@dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
$devNum= 0;
foreach $dev (@dev_list) {
$device_type = $dev->getdevicetype();
if ($device_type ne 'urn:schemas-upnp-org:device:MediaServer:1') {
next;
}
print "[$devNum] : " . $dev->getfriendlyname() . "\n";
unless ($dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1')) {
next;
}
$condir_service = $dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1');
unless (defined(condir_service)) {
next;
}
%action_in_arg = (
'ObjectID' => 0,
'BrowseFlag' => 'BrowseDirectChildren',
'Filter' => '*',
'StartingIndex' => 0,
'RequestedCount' => 0,
'SortCriteria' => '',
);
$action_res = $condir_service->postcontrol('Browse', \%action_in_arg);
unless ($action_res->getstatuscode() == 200) {
next;
}
$actrion_out_arg = $action_res->getargumentlist();
unless ($actrion_out_arg->{'Result'}) {
next;
}
$result = $actrion_out_arg->{'Result'};
while ($result =~ m/<dc:title>(.*?)<\/dc:title>/sgi) {
print "\t$1\n";
}
$devNum++;
}
ngl this snippet is a whole journey: search the network, skip anything that isn't a MediaServer, grab the ContentDirectory service, post aBrowseaction, check the status code is200, then slurp every<dc:title>out of the result with a regex. she ate. π
π¦ DESCRIPTION π¦
so basically, this package gets used as an object of the action response. that's the description. short, sweet, iconic. π
π METHODS π
β getstatuscode β get the status code
$status_code = $actionres->getstatuscode();
grab the status code of the SOAP response. that's the whole job and she does it flawlessly β¨
π getargumentlist β get the argument list
\%argument_list = $actionres->getargumentlist();
grab the argument list of the SOAP response. returns a hashref, obviously. we love a hashref π
π AUTHOR π
Satoshi Konno β skonno@cybergarage.org
CyberGarage β http://www.cybergarage.org
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 by Satoshi Konno
It may be used, redistributed, and/or modified under the terms of BSD License.
and that's the page, bestie!! π this little beauty is perl v5.36.0, dated 2022-12-06, and it lives at Net::U...esponse(3pm). lowkey iconic of it. go forth and Browse β¨π¦π
π¦ where this page comes from
- debian bookworm: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- debian trixie: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu noble: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu resolute: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu stonking: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms