NAME

WWW::VieDeMerde - A perl module to use the viedemerde.fr API

VERSION

Version 0.21

SYNOPSIS

use WWW::VieDeMerde;

my $toto = WWW::VieDeMerde->new();
my $tata = $toto->last();
my $tata = $toto->page(17);
my $tata = $toto->random();
my $tata = $toto->get(1234);

print $tata->text, $tata->author;

DESCRIPTION

viedemerde.fr and fmylife.com are microblogs where people post short messages in order to show how their life is crappy. It offers a simple but efficient http-based API.

This module aims to implement a full interface for the version 2.0 of the API. The full documentation is here: http://dev.betacie.com/viewtopic.php?id=6.

METHODS

new

Creates a new WWW::VieDeMerde object.

Parameters are:

  • key

    Your developper key. The defaults value ("readonly") is sufficient for readonly functions. You can ask for a key here: http://www.viedemerde.fr/api/developpeurs or http://www.fmylife.com/api/developers.

  • token

    The authentification to use an user account. See the API doc.

    Not sure it will works.

  • url

    The URL of the API server. Do not change it, the defaults value ("api.betacie.com") is good enough.

page

$vdm->page() returns the last 15 entries.

$vdm->page($n) the $n page (0 is the last one).

If the page you ask is empty, returns an empty list.

last

$vdm->last alias for $vdm->page.

random

$vdm->random() returns a random entry.

get

$vdm->get($id) returns the item number $id.

comments

$vdm->comments($id) returns the comments of the item $id.

top

$vdm->top() returns the 15 better ranked entries.

This function and all the top_* and flop_* functions accept a page number as argument.

top_day

$vdm->top_day() returns the top of the day.

top_jour

$vdm->top_jour is an alias for $vdm->top_day.

top_week

$vdm->top_week() return the week top.

top_semaine

$vdm->top_semaine is an alias for $vdm->top_week.

top_month

$vdm->top_month() returns the month top.

top_mois

$vdm->top_mois is an alias for $vdm->top_month.

flop

$vdm->flop() returns the global top.

flop_day

$vdm->flop_day() returns day flop.

flop_jour

$vdm->flop_jour is an alias for $vdm->top_day.

flop_week

$vdm->flop_week() returns week flop.

flop_semaine

$vdm->flop_semaine is an alias for $vdm->flop_semain.

flop_month

$vdm->flop_month() returns month flop.

flop_mois

$vdm->flop_mois is an alias for $vdm->flop_month.

categories

$vdm->categories($cat) returns a list for all categories.

from_cat

$vdm->from_cat($cat) returns entries of the category $cat.

errors

Read/write accessor for errors.

INTERNAL METHODS AND FUNCTIONS

_run

Build the request by joining arguments with slashes.

_errors

Detect errors in an xml fragment returned by _run.

raw_xml

Outputs raw xml for the given commands.

AUTHOR

Olivier Schwander, <olivier.schwander at ens-lyon.org>

BUGS

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

SUPPORT

A darcs repository is available here :

http://chadok.info/darcs/WWW-VieDeMerde

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

perldoc WWW::VieDeMerde

You can also look for information at:

SEE ALSO

WWW::FMyLife

In early development, it seems to intend to support votes and comments which is not my priority right now. Supports both French and English version, despite the name.

COPYRIGHT & LICENSE

Copyright 2008 Olivier Schwander, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.