NAME

Net::Dopplr - interface with Dopplr.com's web service

SYNOPSIS

my $dopplr = Net::Dopplr->new($token);

my $fellows = $dopplr->fellows('muttley');

print "I share my trips with ".scalar(@{$fellows->{show_trips_to}})." people\n"; 
print "I can see ".scalar(@{$fellows->{can_see_trips_of}})." people's trips\n"; 

GETTING A DEVELOPER TOKEN

This is a bit involved because Dopplr is still in beta.

First visit this URL

https://www.dopplr.com/api/AuthSubRequest?next=http%3A%2F%2Fwww.example.com%2Fdopplrapi&scope=http%3A%2F%2Fwww.dopplr.com%2F&session=1

(Or you can replace next with you own web app). That will give you a developer token.

You can then upgrade this to a permanent session token.

I use this script.

 use strict;
 use Net::Google::AuthSub;

 my $token = shift;
 my $auth = Net::Google::AuthSub->new( url => 'https://www.dopplr.com/api');

 $auth->auth('null', $token);
 my $sess    = $auth->session_token() || die "Couldn't get token: $@";
 print "Session token = $sess\n";

and then later

my $dopplr = Net::Dopplr->new($sess);

You can then use the session token from that point forward.

METHODS

More information here

http://dopplr.pbwiki.com/API+Resource+URLs

new <token>

Requires a developer token or a session token.

TRAVELLER METHODS

fellows [traveller]

Get people traveller shares information with.

If traveller is not provided then defaults to the logged-in user.

traveller_info [traveller]

Get information about a traveller.

If traveller is not provided then defaults to the logged-in user.

trips_info [traveller]

Get info about the trips of a traveller.

If traveller is not provided then defaults to the logged-in user.

future_trips_info [traveller]

Returns a list of all trips entered by the selected user that have yet to finish.

If traveller is not provided then defaults to the logged-in user.

fellows_travellingtoday [traveller]

Get which of traveller's fellows are travelling today.

If traveller is not provided then defaults to the logged-in user.

tag <tag> [traveller].

Returns data about all trips with a specific tag.

For more information about tags see

http://dopplr.pbwiki.com/Tags

If traveller is not provided then defaults to the logged-in user.

location_on_date <date> [traveller]

Returns the location of a traveller on a particular date.

Date should be in ISO date format e.g

2007-04-01

If traveller is not provided then defaults to the logged-in user.

TRIP METHODS

trip_info <trip id>

Get info about a specific trip.

add_trip_tags <trip id> <tag[s]>

Add tags to a trip.

add_trip_note <trip id> <note>

Add a note to a trip.

delete_trip <trip_id>

Delete a trip

CITY METHODS

city_info <geoname id>

Get info about a City.

Use search to get the geoname id.

add_trip <geoname id> <start> <finish>

Add a trip for the currently logged in user.

Use search to get the geoname id.

Dates should be in ISO date format e.g

2007-04-01

SEARCH METHODS

search <term>

Searches for travellers or cities.

city_search <term>

Searches for cities.

<term>

Searches for travellers.

OTHER METHODS

update_traveller <opt[s]>

Update a traveller's details.

Takes a hash with the new values. Possible keys are

email
forename
surname
password

AUTHOR

Simon Wistow <simon@thegestalt.org>

COPYRIGHT

Copyright 2008, Simon Wistow

Distributed under the same terms as Perl itself.