NAME

WebService::Slack::IncomingWebHook - slack incoming webhook client

SYNOPSIS

# for perl program
use WebService::Slack::IncomingWebHook;
my $client = WebService::Slack::IncomingWebHook->new(
    webhook_url => 'http://xxxxxxxxxxxxxx',
);
$client->post(
    text       => 'yahoooooo!!',
);

# for cli
% post-slack --webhook_url='https://xxxxxx' --text='yahooo'

DESCRIPTION

WebService::Slack::IncomingWebHook is slack incoming webhooks client. Slack is chat web service. For cli, this distribution provides post-slack command.

METHOD

WebService::Slack::IncomingWebHook->new(%params)
my $client = WebService::Slack::IncomingWebHook->new(
    webhook_url => 'http://xxxxxxxxxxxxxx', # required
    channel    => '#general',               # optional
    username   => 'masasuzu',               # optional
    icon_emoji => ':sushi:',                # optional
    icon_url   => 'http://xxxxx/xxx.jpeg',  # optional
);

Creates new object.

$client->post(%params)
$client->post(
    text       => 'yahoooooo!!',
    channel    => '#general',
    username   => 'masasuzu',
    icon_emoji => ':sushi:',
    icon_url   => 'http://xxxxx/xxx.jpeg',
);

Posts to slack incoming webhooks. channel, username, icon_emoji and icon_url parameters can override constructor's parameter.

text, pretext, color, fields and attachments parameter are available. See also slack incoming webhook document.

SCRIPT

% post-slack --webhook_url='https://xxxxxx' --text='yahooo'

available options are ...

--webhook_url (required)
--text (required)
--channel (optional)
--username (optional)
--icon_url (optional)
--icon_emoji (optional)

SEE ALSO

https://my.slack.com/services/new/incoming-webhook

LICENSE

Copyright (C) SUZUKI Masashi.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

SUZUKI Masashi <m15.suzuki.masashi@gmail.com>