Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Net::Yadis 1.0

    Download button

    No screenshots available
    Downloads: 333  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dag Arneson | More programs
    Perl Artistic License / FREE
    June 5th, 2009, 20:59 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Net::Yadis description

    Performs the Yadis service discovery protocol

    Net::Yadis is a Perl module that performs the Yadis service discovery protocol, and parses XRDS xml documents.

    Methods

    discover

    This constructor performs the discovery protocol on a url and returns a yadis object that parses the XRDS document for you.

     eval {
     $yadis=Net::Yadis->discover($url);
     }
     warn "Yadis failed: $@" if $@;


    Will die on errors: HTTP errors, missing Yadis magic, malformed XRDS

    new

    You may also skip discovery and go straight to xrds parsing with the new constructor.

     $yadis = Net::Yadis->new($yadis_url, $xrds_url, $xml);

    $yadis_url

     the identity URL

    $xrds_url

     where we got the xrds document

    $xml

     the XRDS xml as text

    We don't trap death from XML::XPath; malformed xml causes this

    Accessor methods

    xml

     The XML text of the XRDS document.

    url

     The Yadis URL.

    xrds_url

     The URL where the XRDS document was found.

    xrds_xpath

    The XML::XPath object used internally is made available to allow custom XPath queries.

    services

    An array of Net::Yadis::Service objects representing the services advertised in the XRDS file.

    filter_services

    Pass in a filter function reference to this guy. The filter function must take a Net::Yadis::Service object, and return a scalar of some sort or undef. The scalars returned from the filter will be returned in an array from this method.

    Example

     my $filter = sub {
     my $service = shift;
     if ($service->is_type($typere)) {
     # here we simply return the service object, but you may return
     # something else if you wish to extract the data and discard
     # the xpath object contained in the service object.
     return $service;
     }
     else {
     return undef;
     }
     };

     my $typeservices = $yadis->filter_services($filter);

    services_of_type

    A predefined filtering method that takes a regexp for filtering service types.

    service_of_type

    Hey, a perl generator! sequential calls will return the services one at a time, in ascending priority order with ties randomly decided. make sure that the type argument is identical for each call, or the list will start again from the top. You'll have to store the yadis object in a session for this guy to be useful.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Yadis service | service discovery | Perl module | Yadis | service | discovery

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM