NAME

WWW::Yandex::Catalog::LookupSite - Query Yandex Catalog for a website's presence, it's Index of Citing, descriptions in the catalog, and the list of categories it belongs to.

SYNOPSIS

    use WWW::Yandex::Catalog::LookupSite;

    my $site = WWW::Yandex::Catalog::LookupSite->new();

    $site->yaca_lookup('www.slovnik.org');

    print $site->tic . "\n";
    print $site->short_description . "\n";
    print $site->long_description . "\n";
    print "$_\n" foreach @{$site->categories};

DESCRIPTION

The WWW::Yandex::Catalog::LookupSite module retrieves website's Thematic Index of Citing, and checks website's presence in Yandex Catalog, retrieves it's descriptions as recorded in the catalog, and the list of categories it belongs to.

This module uses LWP::Simple for making requests to Yandex Catalog.

Data retrieved

Thematic Index of Citing (tIC) is technology of Yandex similar to Google's Page Rank. The tIC value's step is 10, so when tIC is under 10, this module will return 0.

Each website in the Yandex Catalog has short description.

Not every website in the Yandex Catalog has long description.

Every website in the Yandex Catalog will belong to at least one category. It may belong to several other categories as well.

CONSTRUCTOR

Creates and returns a new WWW::Yandex::Catalog::LookupSite object.

    my $site = WWW::Yandex::Catalog::LookupSite->new();

    

DATA-FETCHING METHODS

$site->yaca_lookup( $uri )

Given a URL/URI, strips unnessesary data from it (scheme, authentication, port, and query), fetches Yandex Catalog with it, and parses results for data.

Returns an array ref to: [ tIC, short description, long description, [catalogs] ]. Returns undef if couldn't fetch the URI.

Short and long description are returned as provided by Yandex, in UTF8 encoding.

Catalogs is an array of strings in format similar to "Auto & Moto / Motorcycles / Yamaha". The leading "Catalog / " is striped, I don't believe there're any sites in root of the catalog.

tIC

undef - if there was an error getting or parsing data. 0 - (a) when site is not present in catalog and tIC is < 10. (b) when site is present in catalog, but the catalog reports it as zero (payed submission). Numeric string when tIC is 10 or greater.

Short Description

Returned only when site is present in catalog (in UTF8 encoding); undef otherwise.

Long Description

Can be undef when site is present in catalog! Not all sites in the catalog have long description. Returned in in UTF8 encoding.

Categories

Empty list is returned when site is not present in catalog. At least one entry when present in catalog.

CONVENIENCE METHODS

These methods can be called only after $site-yaca_lookup( $uri )>

$site->is_in_catalog

Returns 1 if any categories has been retrieved; 0 otherwise.

$site->tic

$site->short_description

$site->long_description

$site->categories

    print $site->tic . "\n";
    if( $site->is_in_catalog ) {
        print $site->short_description . "\n";
        print $site->long_description . "\n";
        print "$_\n" foreach @{$site->categories};
    }

AUTHOR

Irakliy Sunguryan, <webmaster at slovnik.org>, http://www.slovnik.org/

BUGS

Please report any to bug-www-yandex-catalog-lookupsite at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Yandex-Catalog-LookupSite.

LICENSE AND COPYRIGHT

Copyright 2010 Irakliy Sunguryan.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.