App-Maisha

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - always use internal pager (RT#61433).
        - extend time/date formats.
        - added regular command protection.
        - updated Net::Twitter API commands.
        - Now requires Net-Twitter-3.18003.
        - updated tests.

0.15    2010-09-26
        - added OAuth support to Identica access.
        - added better protection for failing commands.
        - removed password from example settings.
        - updated tests.
        - Now requires Net-Twitter-3.13009.

0.14    2010-09-11
        - documentation fix for INI format example (thanks to Alan Haggai Alavi).
        - rewrite to Twitter.pm to use OAuth mechanism for logging in.
        - interface to plugins changed, now passes a config hash.
        - config hash now saves the home directory.
        - added META.json file and associated test.

lib/App/Maisha/Plugin/Identica.pm  view on Meta::CPAN

=back

=head1 AUTHENTICATION

As Twitter has now disabled Basic Authentication to access their API, to be 
consistent Maisha now requires that access to both Twitter and Identica uses
OAuth.

With this new method of authentication, the application will provide a URL,
which the user needs to cut-n-paste into a browser to logging in to the 
service, using your regular username/password, then 'Allow' Maisha to access 
your account. This will then allow Maisha to post to your account. You will 
then be given a PIN, which should then be entered at the prompt on the Maisha
command line.

Once you have completed authentication, the application will then store your 
access tokens permanently under your profile on your computer. Then when you
next use the application it will retrieve these access tokens automatically and
you will no longer need to register the application.

For further information please see the Identica FAQ - 

lib/App/Maisha/Plugin/Twitter.pm  view on Meta::CPAN

=head1 AUTHENTICATION

On 31st August 2010, Twitter disabled Basic Authentication to access their API.
Instead they have introduce the OAuth method of authrntication, which now 
requires application developers to request the user to authenticate themselves 
and provide a PIN (Personal Identification Number) to allow the application to
retrieve access tokens.

With this new method of authentication, the application will provide a URL,
which the user needs to cut-n-paste into a browser to logging in to the 
service, using your regular username/password, then 'Allow' Maisha to access 
your account. This will then allow Maisha to post to your account. You will 
then be given a PIN, which should then be entered at the prompt on the Maisha
command line.

Once you have completed authentication, the application will then store your 
access tokens permanently under your profile on your computer. Then when you
next use the application it will retrieve these access tokens automatically and
you will no longer need to register the application.

=head1 SEE ALSO

lib/App/Maisha/Shell.pm  view on Meta::CPAN

    $self->services($services);
    $self->_reset_networks;
}

*run_connect = \&connect;
sub smry_connect { "connect to a service" }
sub help_connect {
    <<'END';

Connects to a named service. Requires the name of the service, together with
the username and password to access the service.
END
}


sub run_disconnect {
    my ($self,$plug) = @_;

    unless($plug) { warn "No plugin supplied\n";   return }

    my $services = $self->services;

script/maisha  view on Meta::CPAN


Prints out a basic usage help screen

=head2 --help | -h

Print out the manual page.

=head1 CONFIGURATION

The configuration file must contain at least one micro-blogging service, with
your username and password for that service, all other configuration settings 
are optional.

The configuration file itself can be in several different formats, XML, YAML, 
JSON, Windows INI files and even pure Perl are all supported, provided you have
the correct distributions to support those file formats. As a guide the 
following are known to work with this application:

  Config::Tiny    - INI file format
  JSON            - JSON file format
  JSON::Syck      - JSON file format

script/maisha  view on Meta::CPAN

knowing the exact screen width being used. As such you can specify a width for
the wrapper to use to ensure the messages are correctly line wrapped. The 
default setting is 80.

=back

=head2 Service Configuration

For each service you have available (the default install includes 'Identica' 
and 'Twitter') include an associated section in your configuration file, 
providing a username and password for that service. If any service fails to 
connect, a warning is emitted. If the application is not able to connect to
any service, the application will terminate with an error message.

=over 4

=item * username

Your username login to your network service account

=item * password

Your password login to your network service account

=back

=head1 COMMANDS

Note that not all services offer all commands. Where commands are not
applicable for a service, and appropriate warning message will be emitted.

=over 4

script/maisha  view on Meta::CPAN


  [CONFIG]
  order=asc
  tag=.

  [Identica]
  username=yourlogin

  [Twitter]
  username=yourlogin
  password=yourpassword

=head3 YAML Style Configuration

Requires YAML or YAML::Syck to be available.

  --- #YAML:1.0
  CONFIG:
    order: asc
    tag: .
  
  Twitter:
    username: yourlogin
  
  Identica:
    username: yourlogin
    password: yourpassword

=head3 Perl Style Configuration

No additional dependencies required.

  {
    CONFIG      => {'order': 'asc','tag': '.'},
    Twitter     => {'username': 'yourlogin'},
    Identica    => {'username': 'yourlogin','password': 'yourpassword'},
  }

=head1 AUTHOR

  Barbie, <barbie@cpan.org>
  for Miss Barbell Productions <http://www.missbarbell.co.uk>.

=head1 COPYRIGHT AND LICENSE

  Copyright (C) 2009-2012 by Barbie

t/30plugin-test.t  view on Meta::CPAN

#!/usr/bin/perl -w
use strict;

use Test::More tests => 30;
use App::Maisha::Plugin::Test;

ok( my $obj = App::Maisha::Plugin::Test->new(), "got object" );
isa_ok($obj,'App::Maisha::Plugin::Test');

my $ret = $obj->login({username => 'blah', password => 'blah'});
is($ret, 1, '.. login done');

my $api = $obj->api();
isa_ok($api,'App::Maisha::Plugin::Test');

foreach my $k ( qw/
    followers
    friends
    friends_timeline
    public_timeline



( run in 0.792 second using v1.01-cache-2.11-cpan-49f99fa48dc )