| Bing-Search documentation | Contained in the Bing-Search distribution. |
Bing::Search::Source::News - Get news results
my $source = Bing::Search::Source::News->new;
The News source fetches news articles given various criteria.
There is a special case, the "empty query", where Bing will return the top news stories. Otherwise, there are three options that interact with each other.
From http://msdn.microsoft.com/en-us/library/dd250884.aspx:
LocationOverride, Category, and SortBy are mutually exclusive. Specifically:
Make sure to read the previous section with regards to LocationOverride,
Category, and SortBy.
Market, Version, Options, and setOptionsSee Bing::Search for documentation on these common attributes.
News_Count and News_Offset retain the familiar interaction as well.The default value for News_Count is 10, with a range of 1 to 15. The sum of
News_Count and News_Offset cannot exceed 15. News_Offset must be 0 or
greater.
News_LocationOverrideOverrides the location for news. If invalid, the default location is used ("everywhere").
The format is US.<state> and is only valid in the en-US market.
News_CategoryFilters results based on a category. Only valid in the en-US market. According to http://msdn.microsoft.com/en-us/library/dd250868.aspx, valid values are:
News_SortByHow to sort the news results. Valid options are Date and Relevance.
Dave Houston, dhouston@cpan.org, 2010
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
| Bing-Search documentation | Contained in the Bing-Search distribution. |
package Bing::Search::Source::News; use Moose; extends 'Bing::Search::Source'; with 'Bing::Search::Role::NewsRequest::Count'; with qw( Bing::Search::Role::SearchRequest::Market Bing::Search::Role::SearchRequest::Version Bing::Search::Role::SearchRequest::Options Bing::Search::Role::NewsRequest::Offset Bing::Search::Role::NewsRequest::LocationOverride Bing::Search::Role::NewsRequest::Category Bing::Search::Role::NewsRequest::SortBy ); sub _build_source_name { 'News' } __PACKAGE__->meta->make_immutable;