WWW-Kickstarter

 view release on metacpan or  search on metacpan

lib/WWW/Kickstarter.pm  view on Meta::CPAN

sub myself {
   my $self = shift;
   return $self->_call_api('users/self', 'single', 'User::Myself', @_);
}

sub my_id {
   my ($self) = @_;
   return $self->{my_id};
}

sub my_notification_prefs {
   my $self = shift;
   return $self->_call_api('users/self/notifications', 'list', 'NotificationPref', @_);
}

sub my_projects_created {
   my $self = shift;
   return $self->_call_api('users/self/projects/created', 'list', 'Project', @_);
}

# There's no way to have 'discover?backed=1' return the results sorted by backing timestamp,

lib/WWW/Kickstarter.pm  view on Meta::CPAN

Returns a L<WWW::Kickstarter::Data::User::Myself> object for the user that logged in.


=head2 myself

   my $myself = $ks->myself();

Fetches and returns the logged-in user as a L<WWW::Kickstarter::Data::User::Myself> object.


=head2 my_notification_prefs

   my @notification_prefs = $ks->my_notification_prefs();

Fetches and returns the the logged-in user's notification preferences of backed projects as L<WWW::Kickstarter::Data::NotificationPref> objects.
The notification preferences for the project created last is returned first.


=head2 my_projects_created

   my @projects = $ks->my_projects_created();

Fetches and returns the projects created by the logged-in user as L<WWW::Kickstarter::Data::Project> objects.

lib/WWW/Kickstarter/Data/NotificationPref.pm  view on Meta::CPAN

=head1 SYNOPSIS

   use WWW::Kickstarter;

   my $email    = '...';  # Your Kickstarter login credentials
   my $password = '...';

   my $ks = WWW::Kickstarter->new();
   $ks->login($email, $password);

   my @notification_prefs = $ks->my_notification_prefs();

   for my $notification_pref (@notification_prefs) {
      print("$notification_pref->project_name -- "
         ."email:".($notification_pref->by_email?"yes":"no")." "
         ."mobile:".($notification_pref->by_mobile?"yes":"no")."\n"
      );
   }


=head1 ACCESSORS

=head2 id

lib/WWW/Kickstarter/Data/User/Myself.pm  view on Meta::CPAN

use warnings;
no autovivification;


use WWW::Kickstarter::Data::User qw( );


our @ISA = 'WWW::Kickstarter::Data::User';


sub notification_prefs { my $self = shift;  return $self->ks->my_notification_prefs(@_); }
sub projects_created   { my $self = shift;  return $self->ks->my_projects_created(@_); }
sub projects_backed    { my $self = shift;  return $self->ks->my_projects_backed(@_); }
sub projects_starred   { my $self = shift;  return $self->ks->my_projects_starred(@_); }


1;


__END__

lib/WWW/Kickstarter/Data/User/Myself.pm  view on Meta::CPAN

=head1 DESCRIPTION

Kickstarter provides more information on the logged-in user than other users.
This class extends L<WWW::Kickstarter::Data::User> to provide that information.


=head1 API CALLS

This class provides the following API calls in addition to those provided by L<WWW::Kickstarter::Data::User>.

=head2 notification_prefs

   my @notification_prefs = $myself->notification_prefs();

Fetches and returns the the logged-in user's notification preferences of backed projects as L<WWW::Kickstarter::Data::NotificationPref> objects.
The notification preferences for the project created last is returned first.


=head2 projects_created

   my @projects = $myself->projects_created();

Fetches and returns the projects created by the logged-in user as L<WWW::Kickstarter::Data::Project> objects.



( run in 0.772 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )