The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WWW::IBM::Search - API to IBM Search

SYNOPSIS

WWW::IBM::Search is an API to http://www.ibm.com/search/?v=14&realm=ibm&cc=us&lang=en&adv.x=1&en=utf&q=foo

    use WWW::IBM::Search;

    my $ibm = WWW::IBM::Search->new(
                where           =>      'United States',
                language        =>      'English',
                display         =>      25,
        ;
    my $results = $ibm->search('+perl +developerworks');
    foreach my $result (@{ $results }) {
        print $result->{'title'},"\t", print $result->{'uri'},"\n";
    }
    ...

METHODS

new

Returns a new WWW::IBM::Search search object. Here are the parameters:

  • where => 'country' (default is 'United States')

    You can specify in which IBM the search will be performed. The following IBMs are available:

            Worldwide
            Anguilla
            Antigua and Barbuda
            Argentina
            Aruba
            Australia
            Austria
            Bahamas
            Bahrain
            Bangladesh
            Barbados
            Belgium
            Bermuda
            Bolivia
            Brazil
            British
            Bulgaria
            Canada
            Cayman Islands
            Chile
            China
            Colombia
            Croatia
            Cyprus
            Czech Republic
            Denmark
            Dominica
            Ecuador
            Egypt
            Estonia
            Finland
            France
            Germany
            Greece
            Grenada
            Guyana
            Hong Kong
            Hungary
            India
            Indonesia
            Ireland
            Israel
            Italy
            Jamaica
            Japan
            Jordan
            Korea, Republic of
            Kuwait
            Latvia
            Lebanon
            Lithuania
            Malaysia
            Mexico
            Montserrat
            Netherlands
            Netherlands Antilles
            New Zealand
            Norway
            Oman
            Pakistan
            Paraguay
            Peru
            Philippines
            Poland
            Portugal
            Qatar
            Romania
            Russian Federation
            Saint Kitts and Nevis
            Saint Lucia
            Saint Vincent and the Grenadines
            Saudi Arabia
            Serbia
            Singapore
            Slovakia
            Slovenia
            South Africa
            Spain
            Sri Lanka
            Suriname
            Sweden
            Switzerland
            Taiwan
            Thailand
            Trinidad and Tobago
            Turkey
            Turks and Caicos Islands
            Ukraine
            United Arab Emirates
            United Kingdom
            United States
            Uruguay
            Venezuela
            Viet Nam
            Virgin Islands
  • language => "language" (default is 'English')

    Your language:

            Any
            Bulgarian
            ChineseS (simplified)
            ChineseT (traditional)
            Croatian
            Czech
            Danish
            Dutch
            English
            Estonian
            Finnish
            French
            German
            Greek
            Hebrew
            Hungarian
            Italian
            Japanese
            Korean
            Latvian
            Lithuanian
            Norwegian
            Polish
            Portuguese
            Romanian
            Russian
            Slovak
            Slovenian
            Spanish
            Swedish
            Turkish
            Ukrainian
  • display => number (default is 100)

    The number of results per page:

            10
            25
            50
            75
            100
  • fetch_all => [0|1] (default is 0)

    Traverses all the result's pages before returning.

  • how => "how" (default is 'all of the words')

            all
            any
            phrase

Before you search, please read the documentaion http://www.ibm.com/search/help/us/en/#improve

Pass the string to search, and, this function will return an array ref, where each element is a result hash (see below).

    my $results = $ibm->search('+perl +developerworks');

    foreach my $result (@{ $results }) {
        say $result->{'title'};
        say $result->{'uri'};
        say $result->{'content_text'};
    }

The attributes below show the information available to you on each query.

title

    print $result->{'title'}

The title name from result.

uri

    print $result->{'uri'}

The uri from result.

content_text

    print $result->{'content_text'}

The content as text from result.

content_html

    print $result->{'content_html'}

The content as HTML from result.

html

    print $result->{'html'}

The literal HTML from result.

AUTHOR

Daniel de Oliveira Mantovani, <daniel.oliveira.mantovani at gmail.com>

BUGS

Please report any bugs or feature requests to bug-www-ibm at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-IBM-Search. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WWW::IBM::Search

You can also look for information at:

ACKNOWLEDGEMENTS

Breno G. Oliveira <garu>

LICENSE AND COPYRIGHT

Copyright 2010 Daniel de Oliveira Mantovani.

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.

See http://dev.perl.org/licenses/ for more information.