Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.22 KB

README.mkdn

File metadata and controls

57 lines (45 loc) · 1.22 KB

Social

Installing

Social is implemented with Perl, you do not need to install itself to get it working, but it requires following CPAN modules to be installed:

  • Encode
  • YAML
  • AnyEvent::IRC
  • FindBin
  • HTML::Entities
  • Plack
  • Plack::Request
  • Tatsumaki
  • AnyEvent::Twitter
  • AnyEvent::Plurk
  • RTPG
  • AnyEvent::RTPG
  • JSON::XS

Running It

At this point, you do not install the Social itself in order to run it. Just cd into the source tree and execute the "social" program.

You need to provide a path to your config file like this:

./social -c /path/to/config.yml

See config/social.yml for the example and description of the configrable content.

API Controller

Social provides an API controller, you can send messages from the API.

For example,

#!/usr/bin/env perl
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON::XS;
use URI;
my $network = ...;
my $channel = ...;
my $msg = shift;
$ua = LWP::UserAgent->new;
my $uri = URI->new( 'http://localhost:9999/api' );
$uri->query_form({ payload => encode_json({ network => $network , channel => $channel , message => $msg }) });
$response = $ua->request(GET $uri );
warn $response->content;