package WWW::Foursquare::RSS::Checkin;

use strict;
use warnings;
use Carp;
use DateTime    qw();
use Date::Parse qw(str2time);

our $VERSION = '0.01';

sub new
    my ($class, $data) = @_;
    my $self = { rss_data => $data };
    bless $self, $class;
    return $self;

=head1 NAME

WWW::Foursquare::RSS::Checkin - Checkin object for L<WWW::Foursquare::RSS>


See L<WWW::Foursquare::RSS>. This module is useless on its own.

=head1 METHODS

=head2 venue_id

Returns the Foursquare venue ID of the venue that was checked in to.


sub venue_id
    my $self = shift;

    return $self->{venue_id} if $self->{venue_id};

    my $link = $self->{rss_data}{'link'};
    if ($link =~ /venue\/(\d+)/) {
        $self->{venue_id} = $1;

    return $self->{venue_id};

=head2 venue_url

Returns the URL for the Foursquare page representing the venue that was checked in to.


sub venue_url
    my $self = shift;
    my $venue_id = $self->venue_id or return;
    return "$venue_id";

=head2 venue_name

Returns the name of the venue that was checked in to.


sub venue_name
    my $self = shift;
    return $self->{rss_data}{title};

=head2 datetime

Returns a DateTime object representing the date/time of the checkin.


sub datetime
    my $self = shift;

    return $self->{datetime} if $self->{datetime};

    my $time = $self->{rss_data}{pubDate} or return;
       $time = DateTime->from_epoch(epoch => str2time($time));
    return $time;


DateTime, Date::Parse


The author of this module is not affiliated in any way with Foursquare.

Users of this module must be sure to follow the Foursquare terms of service.


Copyright (C) 2010 Michael Aquilina. All rights reserved.

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

=head1 AUTHOR

Michael Aquilina,