{
    "content": [
        {
            "type": "text",
            "text": "# Net::OpenID::Yadis (perldoc)\n\n## NAME\n\nNet::OpenID::Yadis - Perform Yadis discovery on URLs\n\n## SYNOPSIS\n\nuse Net::OpenID::Yadis;\nmy $disc = Net::OpenID::Yadis->new(\nconsumer => $consumer, # Net::OpenID::Consumer object\n);\nmy $xrd = $disc->discover(\"http://id.example.com/\") or Carp::croak($disc->err);\nprint $disc->identityurl;       # Yadis URL (Final URL if redirected)\nprint $disc->xrdurl;            # Yadis Resourse Descriptor URL\nforeach my $srv (@$xrd) {        # Loop for Each Service in Yadis Resourse Descriptor\nprint $srv->priority;          # Service priority (sorted)\nprint $srv->Type;              # Identifier of some version of some service (scalar, array or array ref)\nprint $srv->URI;               # URI that resolves to a resource providing the service (scalar, array or array ref)\nprint $srv->extrafield(\"Delegate\",\"http://openid.net/xmlns/1.0\");\n# Extra field of some service\n}\n# If you are interested only in OpenID. (either 1.1 or 2.0)\nmy $xrd = $self->services(\n'http://specs.openid.net/auth/2.0/signon',\n'http://specs.openid.net/auth/2.0/server',\n'http://openid.net/signon/1.1',\n);\n# If you want to choose random server by code-ref.\nmy $xrd = $self->services(sub{($[int(rand(@))])});\n\n## DESCRIPTION\n\nThis module provides an implementation of the Yadis protocol, which does XRDS-based service\ndiscovery on URLs.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONSTRUCTOR**\n- **EXPORT**\n- **METHODS**\n- **COPYRIGHT**\n- **WARRANTY**\n- **SEE ALSO**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::OpenID::Yadis",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::OpenID::Yadis - Perform Yadis discovery on URLs",
        "synopsis": "use Net::OpenID::Yadis;\nmy $disc = Net::OpenID::Yadis->new(\nconsumer => $consumer, # Net::OpenID::Consumer object\n);\nmy $xrd = $disc->discover(\"http://id.example.com/\") or Carp::croak($disc->err);\nprint $disc->identityurl;       # Yadis URL (Final URL if redirected)\nprint $disc->xrdurl;            # Yadis Resourse Descriptor URL\nforeach my $srv (@$xrd) {        # Loop for Each Service in Yadis Resourse Descriptor\nprint $srv->priority;          # Service priority (sorted)\nprint $srv->Type;              # Identifier of some version of some service (scalar, array or array ref)\nprint $srv->URI;               # URI that resolves to a resource providing the service (scalar, array or array ref)\nprint $srv->extrafield(\"Delegate\",\"http://openid.net/xmlns/1.0\");\n# Extra field of some service\n}\n# If you are interested only in OpenID. (either 1.1 or 2.0)\nmy $xrd = $self->services(\n'http://specs.openid.net/auth/2.0/signon',\n'http://specs.openid.net/auth/2.0/server',\n'http://openid.net/signon/1.1',\n);\n# If you want to choose random server by code-ref.\nmy $xrd = $self->services(sub{($[int(rand(@))])});",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "CONSTRUCTOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "EXPORT",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 71,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "WARRANTY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::OpenID::Yadis - Perform Yadis discovery on URLs\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 1.20\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Net::OpenID::Yadis;\n\nmy $disc = Net::OpenID::Yadis->new(\nconsumer => $consumer, # Net::OpenID::Consumer object\n);\n\nmy $xrd = $disc->discover(\"http://id.example.com/\") or Carp::croak($disc->err);\n\nprint $disc->identityurl;       # Yadis URL (Final URL if redirected)\nprint $disc->xrdurl;            # Yadis Resourse Descriptor URL\n\nforeach my $srv (@$xrd) {        # Loop for Each Service in Yadis Resourse Descriptor\nprint $srv->priority;          # Service priority (sorted)\nprint $srv->Type;              # Identifier of some version of some service (scalar, array or array ref)\nprint $srv->URI;               # URI that resolves to a resource providing the service (scalar, array or array ref)\nprint $srv->extrafield(\"Delegate\",\"http://openid.net/xmlns/1.0\");\n# Extra field of some service\n}\n\n# If you are interested only in OpenID. (either 1.1 or 2.0)\nmy $xrd = $self->services(\n'http://specs.openid.net/auth/2.0/signon',\n'http://specs.openid.net/auth/2.0/server',\n'http://openid.net/signon/1.1',\n);\n\n# If you want to choose random server by code-ref.\nmy $xrd = $self->services(sub{($[int(rand(@))])});\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides an implementation of the Yadis protocol, which does XRDS-based service\ndiscovery on URLs.\n\nThis module was originally developed by OHTSUKA Ko-hei as Net::Yadis::Discovery, but was forked\nand simplified for inclusion in the core OpenID Consumer package.\n\nThis simplified version is tailored for the needs of Net::OpenID::Consumer; for other uses,\nNet::Yadis::Discovery is probably a better choice.\n",
                "subsections": []
            },
            "CONSTRUCTOR": {
                "content": "\"new\"\nmy $disc = Net::OpenID::Yadis->new([ %opts ]);\n\nYou can set the \"consumer\" in the constructor. See the corresponding method description\nbelow.\n",
                "subsections": []
            },
            "EXPORT": {
                "content": "This module exports three constant values to use with discover method.\n\n\"YRGET\"\nIf you set this, module check Yadis URL start from HTTP GET request. This is the default.\n\n\"YRXRDS\"\nIf you set this, this module consider Yadis URL as Yadis Resource Descriptor URL. If not so,\nan error is returned.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "$disc->consumer($consumer)\n$disc->consumer\nGet or set the Net::OpenID::Consumer object that this object is associated with.\n\n$disc->discover($url,[$requestmethod])\nGiven a user-entered $url (which could be missing http://, or have extra whitespace, etc),\nreturns either array/array ref of Net::OpenID::Yadis::Service objects, or undef on failure.\n\n$requestmethod is optional, and if set this, you can change the HTTP request method of\nfetching Yadis URL. See EXPORT to know the value you can set, and default is YRHEAD.\n\nIf this method returns undef, you can rely on the following errors codes (from\n$csr->errcode) to decide what to present to the user:\n\nxrdparseerror\nxrdformaterror\ntoomanyhops\nnoyadisdocument\nurlfetcherr\nemptyurl\nurlgone\n\n$disc->xrdobjects\nReturns array/array ref of Net::OpenID::Yadis objects. It is same what could be got by\ndiscover method.\n\n$disc->identityurl\nReturns Yadis URL. If not redirected, it is same with the argument of discover method.\n\n$disc->xrdurl\nReturns Yadis Resource Descriptor URL.\n\n$disc->servers($protocol,$protocol,...)\n$disc->servers($protocol=>[$version1,$version2],...)\n$disc->servers($protocol,....,$coderef);\nFilter method of xrdobjects.\n\nIf no option is defined, returns same result with xrdobjects method.\n\nprotocol names or Type URLs are given, filter only given protocol. Two or more protocols are\ngiven, return and results of filtering.\n\nSample: $disc->servers(\"openid\",\"http://lid.netmesh.org/sso/1.0\");\n\nIf reference of version numbers array is given after protocol names, filter only given\nversion of protocol.\n\nSample: $disc->servers(\"openid\"=>['1.0','1.1'],\"lid\"=>['1.0']);\n\nIf you want to use version numbers limitation with type URL, you can use \\ver as place\nholder of version number.\n\nSample: $disc->servers(\"http://lid.netmesh.org/sso/\\ver\"=>['1.0','2.0']);\n\nIf code reference is given as argument , you can make your own filter rule. code reference\nis executed at the last of filtering logic, like this:\n\n@results = $coderef->(@temporaryresults)\n\nSample: If you want to filter OpenID server and get only first one: ($openidserver) =\n$disc->servers(\"openid\",sub{$[0]});\n\n$disc->err\nReturns the last error, in form \"errcode: errtext\"\n\n$disc->errcode\nReturns the last error code.\n\n$disc->errtext\nReturns the last error text.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is Copyright (c) 2006 OHTSUKA Ko-hei. All rights reserved.\n\nYou may distribute under the terms of either the GNU General Public License or the Artistic\nLicense, as specified in the Perl README file.\n",
                "subsections": []
            },
            "WARRANTY": {
                "content": "This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Yadis website: <http://yadis.org/>\n\nNet::OpenID::Yadis::Service\n\nNet::OpenID::Consumer\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Based on Net::Yadis::Discovery by OHTSUKA Ko-hei <nene@kokogiko.net>\n\nMartin Atkins <mart@degeneration.co.uk>\n",
                "subsections": []
            }
        }
    }
}