Net::U...sponse(3pm)

πŸ“¦
version 1.4.6 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Net::UPnP::QueryResponse β€” the Perl extension for UPnP, bestie πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the whole vibe, copy it exactly, no cap:

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++;
}

🌸 DESCRIPTION 🌸

So like, this package is the object you get handed back for an action response πŸ’…. That's its whole job. It's giving "I hold the reply, you ask me questions about it."


πŸ¦‹ METHODS πŸ¦‹

getstatuscode β€” get the status code

$status_code = $queryres->getstatuscode();

Grabs the status code off the SOAP response. Like, was it a 200 or were we in our flop era? This tells you 🫢.

getvalue β€” get the return value

$value = $queryres->getvalue();

Gets the value of the SOAP response. That's it, that's the method ✨.


πŸ‘‘ AUTHOR πŸ‘‘

Satoshi Konno skonno@cybergarage.org

CyberGarage http://www.cybergarage.org


Copyright (C) 2005 by Satoshi Konno

It may be used, redistributed, and/or modified under the terms of BSD License. Slay, honestly β€” permissive licensing is the moment.


This icon of a page is from the User Contributed Perl Documentation, and the footer was literally serving perl v5.36.0 dated 2022-12-06. That's the whole manual bestie, go forth and query those responses πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from