NAME
Exobrain - Automate your life with Exobrain
VERSION
version 1.08
SYNOPSIS
use Exobrain;
my $exobrain = Exobrain->new;
$exobrain->notify("Hello World");
DESCRIPTION
Exobrain is a collection of agents which collect, classify, and act upon data. They share a common bus for communication. Think of it as IFTTT, but free, open source, and *you* keep control of your privacy.
Examples of things that exobrain can currently do:
Give you XP in HabitRPG when you update your beeminder goals
Let others add items to your RememberTheMilk ToDo lists via twitter
Update beeminder by checking your inbox sizes using IMAP
Reward with HabitRPG XP you for responding to email
Automatically log life events to idonethis
You can find out more information about Exobrain, including the full README, install instructions, current development, and more on github. In particular, the README is strongly suggested reading.
Using Exobrain
will automatically enable both strict
, warnings
, and Perl 5.10 features (such as say
).
The following are methods provided by the top-level Exobrain object:
METHODS
watch_loop
$exobrain->watch_loop(
class => 'Measurement::Geo',
filter => sub { $_->is_me },
then => sub { ... },
);
When we see packets of a particular class, do a particular thing. The class
need not strictly be a class, but may also be a role
.
The 'Exobrain::' prefix should not be supplied to the class/roles you are searching for.
If the optional debug
option is passed with a coderef, that will be run for every event in the desired class, before the filter is evaluated.
The event is passed as the first argument to all coderefs. As a convenience, it is also placed inside $_
.
Never returns, just runs the loop forever.
notify
$exobrain->notify($msg
priority => -1,
);
Takes a mandatory message, and any arguments that can be passeed to Exobrain::Intent::Notify, and notifies the user. At the time of writing, notifications are done by the pushover end-point by default.
This is a thin wrapper around $exobrain-
intent('Notify', ... >.
message
$exobrain->message( ... );
Shortcut to create a 'raw' message. The exobrain parameter will be passed to the class constructor automatically.
The message will be sent automatically, unless the nosend
parameter is set to a true value.
measure
$exobrain->measure( 'Mailbox',
count => 42,
user => 'pjf',
server => 'imap.example.com',
fodler => 'INBOX',
)->send;
Preferred shortcut for creating a measurement of the desired class. The exobrain
parameter will be passed to the measurement class constructor automatically.
intent
my $intent = $exobrain->intent( 'Tweet',
tweet => 'Hello World',
);
Preferred shortcut for making an intent of the desired class. The exobrain
parameter will be passed to the intent class constructor automatically.
run
$exobrain->run($agent);
Runs the agent of the class specified. The agent name is automatically prepended with "Exobrain::Agent::" and loaded first. This method never returns.
This is usually called from the exobrain
cmdline program.
can_run
if ($exobrain->can_run('Action::Foo') { ... }
Checks to see if a given agent could be run. (Ie, it can be loaded, and all its dependencies are satisified.)
AUTHOR
Paul Fenwick <pjf@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Paul Fenwick.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.