The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::RT::CPAN - Scrape information from https://rt.cpan.org

VERSION

This document describes version 0.002 of WWW::RT::CPAN (from Perl distribution WWW-RT-CPAN), released on 2017-02-03.

SYNOPSIS

 use WWW::RT::CPAN qw(
     list_dist_active_tickets
     list_dist_resolved_tickets
     list_dist_rejected_tickets
 );

 my $res = list_dist_active_tickets(dist => 'Acme-MetaSyntactic');

Sample result:

 [
   200,
   "OK",
   [
     {
       broken_in => [], # e.g. ["0.40", "0.41"]
       fixed_in => [],
       id => 120076,
       last_updated_raw => "8 hours ago",
       severity => "Wishlist",
       status => "new",
       title => "Option to return items in order?",
     },
     {
       broken_in => [],
       fixed_in => [],
       id => 118805,
       last_updated_raw => "3 months ago",
       severity => "Wishlist",
       status => "new",
       title => "Print list of categories of a theme?",
     },
   ],
  ]

Another example (dist not found):

 my $res = list_dist_active_tickets(dist => 'Foo-Bar');

Example result:

 [400, "No such distribution"]

DESCRIPTION

This module provides some functions to retrieve data from https://rt.cpan.org by scraping the web pages. Compared to RT::Client::REST, it provides less functionality but it can get public information without having to log in first.

FUNCTIONS

list_dist_active_tickets

Usage:

 list_dist_active_tickets(%args) -> [status, msg, result, meta]

List active tickets for a distribution.

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • dist* => perl::distname

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

list_dist_rejected_tickets

Usage:

 list_dist_rejected_tickets(%args) -> [status, msg, result, meta]

List rejected tickets for a distribution.

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • dist* => perl::distname

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

list_dist_resolved_tickets

Usage:

 list_dist_resolved_tickets(%args) -> [status, msg, result, meta]

List resolved tickets for a distribution.

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • dist* => perl::distname

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/WWW-RT-CPAN.

SOURCE

Source repository is at https://github.com/perlancar/perl-WWW-RT-CPAN.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=WWW-RT-CPAN

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

RT::Client::REST

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.