Ignore:
Timestamp:
Sep 19, 2011, 1:31:35 PM (13 years ago)
Author:
Edward Z. Yang <ezyang@mit.edu>
Children:
d387e0d
Parents:
ac45403
git-author:
Edward Z. Yang <ezyang@mit.edu> (06/23/11 22:44:48)
git-committer:
Edward Z. Yang <ezyang@mit.edu> (09/19/11 13:31:35)
Message:
Refine module setup process.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Location:
perl/modules/Facebook/lib/BarnOwl/Module
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Facebook/lib/BarnOwl/Module/Facebook.pm

    rac45403 r9776805  
    7373BarnOwl::new_command('facebook-auth' => \&cmd_facebook_auth, {
    7474    summary     => 'Authenticate as a Facebook user.',
    75     usage       => 'facebook-auth URL',
     75    usage       => 'facebook-auth [URL]',
    7676    description => 'Authenticate as a Facebook user.  URL should be the page'
    77                 ."\nFacebook redirects you to after OAuth login."
     77                ."\nFacebook redirects you to after OAuth login.  If no URL"
     78                ."\nis specified, output instructions for logging in."
    7879});
    7980
  • perl/modules/Facebook/lib/BarnOwl/Module/Facebook/Handle.pm

    rbc56a0d r9776805  
    112112
    113113    $self->{facebook} = Facebook::Graph->new( app_id => $app_id );
    114     $self->facebook_do_auth;
     114    if ( defined $self->{cfg}->{token} ) {
     115        $self->facebook_do_auth;
     116    }
    115117
    116118    return $self;
     
    400402    my $url = shift;
    401403
     404    if (!defined $url) {
     405        $self->facebook_do_auth;
     406        return;
     407    }
     408
    402409    # http://www.facebook.com/connect/login_success.html#access_token=TOKEN&expires_in=0
    403410    $url =~ /access_token=([^&]+)/; # XXX Ew regex
Note: See TracChangeset for help on using the changeset viewer.