WWW::FMyLife - Obtain FMyLife.com anecdotes via API
Version 0.15
THIS MODULE IS STILL UNDER INITIAL DEVELOPMENT! BE WARNED!
use WWW::FMyLife; my $fml = WWW::FMyLife->new(); print map { "Items: $_\n" } $fml->last( { as => text' } );
This module fetches FMyLife.com (FML) anecdotes, comments, votes and more via API, comfortably and in an extensible manner.
my @items = $fml->top_daily(); foreach my $item (@items) { my $item_id = $item->id; my $item_content = $item->content; print "[$item_id] $item_content\n"; } print $fml->random()->text, "\n"; ...
This module exports nothing.
Fetches the last quotes. Can accept a hashref that indicates the formatting:
# returns an array of WWW::FMyLife::Item objects $fml->last(); # or more explicitly $fml->last( { as => 'object' } ); # same as above $fml->last( { as => 'text' } ); # returns an array of text anecdotes $fml->last( { as => 'data' } ); # returns an array of hashes of anecdotes
You can also specify which page you want:
# return 1st page my @last = fml->last(); # return 5th page my @last = $fml->last(5); # same my @last = $fml->last( { page => 5 } );
And options can be mixed:
my @not_so_last = $fml->last( { as => 'text', page => 50 } );
This method gets a single random quote as an object.
This method works the same as the last() method, only it fetches the top quotes.
This method, as for its variations, can format as an object, text or data.
This method works the same as the last() method, only it fetches the top quotes.
This specific variant fetches the top anecdotes from the last day.
This method works the same as the last() method, only it fetches the top quotes.
This specific variant fetches the top anecdotes from the last week.
This method works the same as the last() method, only it fetches the top quotes.
This specific variant fetches the top anecdotes from the last month.
Fetches the flop quotes.
This method, as for its variations, can format as an object, text or data.
Fetches the flop quotes of the day.
Fetches the flop quotes of the week.
Fetches the flop quotes of the month.
WARNING: THIS HAS NOT YET BEEN IMPLEMENTED.
THE TESTS HAVE BEEN DISABLED FOR NOW, PLEASE WAIT FOR A MORE ADVANCED VERSION.
Sets credentials for members.
$fml->credentials( 'foo', 'bar' ); # same thing $fml->username('foo'); $fml->password('bar');
Sawyer X (XSAWYERX), <xsawyerx at cpan.org>
Tamir Lousky (TLOUSKY), <tlousky at cpan.org>
Please report any bugs or feature requests to bug-www-fmylife at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-FMyLife.
You can also use the Issues Tracker on Github @ http://github.com/xsawyerx/www-fmylife/issues.
You can find documentation for this module with the perldoc command.
perldoc WWW::FMyLife
You can also look for information at:
Apparently supports more options right now. Mainly for French version but seems to support English as well.
Copyright 2010 Sawyer X, Tamir Lousky.
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.