Changeset 525dd8d


Ignore:
Timestamp:
Jun 23, 2011, 10:44:48 PM (13 years ago)
Author:
Edward Z. Yang <ezyang@mit.edu>
Children:
4839f5a
Parents:
3d304b9
Message:
Refine module setup process.

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

Legend:

Unmodified
Added
Removed
  • perl/modules/Facebook/README

    r2f6c263 r525dd8d  
    66
    77SYNOPSIS
    8   (1) Create an empty file ~/.owl/facebook (you can use the command
    9   `touch ~/.owl/facebook`), in order to enable the module.
     8  (1) Run ":reload-module Facebook" inside BarnOwl, if the module has
     9  not been loaded already.
    1010
    11   (2) Run ":reload-module Facebook" inside BarnOwl.
    12 
    13   (3) Follow the instructions in the admin message.  BarnOwl will
    14   ask you to log in via an OAuth URL, and run ':facebook-auth'
    15   with the resulting URL.  It will then ask you to record the
    16   resulting access token in your ~/.owl/facebook file, so you do
    17   not have to login on subsequent BarnOwl sesions.
     11  (2) Run ':facebook-auth'.  Follow the instructions in the admin
     12  message.  BarnOwl will ask you to log in via an OAuth URL, and run
     13  ':facebook-auth $URL' where $URL is the URL you were redirected to.
     14  It will then ask you to record the resulting access token in an
     15  ~/.owl/facebook file, so you do not have to login on subsequent
     16  BarnOwl sesions.
    1817
    1918  This token is valid until you change your
     
    2120    http://www.facebook.com/settings/?tab=applications&app_id=235537266461636
    2221
    23   (4) Start receiving wall updates in Barnowl!
     22  (3) Start receiving wall updates in Barnowl!
    2423  You can post updates with the ":facebook" command.
    2524
  • perl/modules/Facebook/lib/BarnOwl/Module/Facebook.pm

    r3d304b9 r525dd8d  
    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

    r2f6c263 r525dd8d  
    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.