Feed::Source::Yahoo - Create a RSS feed based on a Yahoo query


Feed-Source-Yahoo documentation Contained in the Feed-Source-Yahoo distribution.

Index


Code Index:

NAME

Top

Feed::Source::Yahoo - Create a RSS feed based on a Yahoo query

VERSION

Top

Version 0.01

SYNOPSIS

Top

If you query Yahoo regurlarly with the same search, maybe is it a good idea to transform this query in a RSS feed. This simple module can help you :

    use Feed::Source::Yahoo;

    my $feed = Feed::Source::Yahoo->new( query => '"information retrieval"');
    print "The feed URL: " . $feed->url() . "\n";

FUNCTIONS

Top

new

url

query

AUTHOR

Top

Emmanuel Di Pretoro, <<manu at bjornoya.net>>

BUGS

Top

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

SUPPORT

Top

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

    perldoc Feed::Source::Yahoo

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Feed-Source-Yahoo

* CPAN Ratings

http://cpanratings.perl.org/d/Feed-Source-Yahoo

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Feed-Source-Yahoo

* Search CPAN

http://search.cpan.org/dist/Feed-Source-Yahoo

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Feed-Source-Yahoo documentation Contained in the Feed-Source-Yahoo distribution.
package Feed::Source::Yahoo;

use warnings;
use strict;
use Carp;

use URI;
use constant {
  URL => "http://api.search.yahoo.com/WebSearchService/rss/webSearch.xml",
};

our $VERSION = '0.01';

sub new {
  my ($class, %arg) = @_;
  my $self = {};
  
  $self->{URI} = URI->new(URL);
  $self->{params}{appid} = "yahoosearchwebrss";
  $self->{params}{query} = $arg{query} if exists $arg{query};
  bless $self, $class;
}

sub url {
  my ($self) = @_;
  if (exists $self->{params}{query}) {
    $self->{URI}->query_form($self->{params});
    $self->{URI}->as_string
  } else {
    croak "You must specify a query...";
  }
}

sub query {
  my $self = shift;
  $self->{params}{query} = shift if @_;
}


1; # End of Feed::Source::Yahoo