孙泉 > WWW-Search-Scrape-0.08 > WWW::Search::Scrape

Download:
WWW-Search-Scrape-0.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.08   Source  

NAME ^

  WWW::Search::Scrape - Scrape search engine results

VERSION ^

Version 0.08

SYNOPSIS ^

  use WWW::Search::Scrape qw/:all/;
  my $result = search({engine => 'google', keyword =>'keywords', results => 10});
  print "Google returns " . $result->{num} . " results\n";
  print $_, "\n" foreach (@{$result->{results}});

DESCRIPTION ^

Most search engines do not provide search API.

Google finally stop its Google search API in Sept 2009, while the registration for it had already been disabled for years. Google AJAX API is not powerful enough.

The purpose of this module is to provide a simple interface to extract top search results from Google search engines (as well as others), and keep this interface as simple as possible (as soon as possible as well).

Currently, it supports English Google and Bing only. I schedule to add more functions soon.

EXPORT ^

There is only one function in WWW::Search::Scrape -- search.

FUNCTIONS ^

search

search is the most important function in this module. It is used as a dispatcher for corresponding search engines -- Google, Yahoo, Bing etc.

It accepts a config hash. Possible keys are,

  +---------+--------------------------------------------------------+
  | engine  | The name for the search engine, like 'google', 'bing'  |
  +---------+--------------------------------------------------------+
  | keyword | The keyword(s) for the searching terms                 |
  +---------+--------------------------------------------------------+
  | results | How many results should be returned    (default: 10)   |
  +---------+--------------------------------------------------------+

It returns a hash ref

  +---------+-------------------------------------------------------------------------+
  |   num   | How many items the search engine are able to return? (estimated number) |
  +---------+-------------------------------------------------------------------------+
  | results | List of returned results                                                +
  +---------+-------------------------------------------------------------------------+

AUTHOR ^

Quan Sun, <qsun at pardiff.com>

BUGS ^

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

http://github.com/qsun/WWW-Search-Scrape

SUPPORT ^

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

    perldoc WWW::Search::Scrape

You can also look for information at:

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENSE ^

Copyright 2009 Quan Sun.

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.

syntax highlighting: