쉽게 확장 가능한 IRC bot hubot 을 소개하고 이를 사용, 확장하는 방법에 대해 이야기 합니다.
Perl 5 를 뜻합니다. Perl 에서는 일반적으로 모듈이름이 대문자로
시작하지만, 소스저장소(repository) 이름으로는 다른 프로젝트와 구별하기
위해서 p5 prefix 를 붙이곤 합니다.
| #!/usr/bin/env perl | |
| use utf8; | |
| use strict; | |
| use warnings; | |
| use LWP::UserAgent; | |
| use HTTP::Cookies; | |
| use HTTP::Request::Common; | |
| my $ua = LWP::UserAgent->new( | |
| agent => 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11 Iceweasel/10.0.11', |
| #!/bin/sh | |
| BZ_ADMIN_EMAIL='<user>@gmail.com' | |
| BZ_ADMIN_PASSWORD='****' | |
| BZ_ADMIN_REALNAME='realname' | |
| BZ_SERVER_NAME='bz4.localhost' | |
| BZ_URLBASE='http://bz4.localhost/' | |
| BZ_APACHE_GROUP='www-data' | |
| BZ_INSTALL_PATH='/home/bugzilla/public_html/bugzilla' |
| #!/bin/sh | |
| BZ_ADMIN_EMAIL='<user>@gmail.com' | |
| BZ_ADMIN_PASSWORD='****' | |
| BZ_ADMIN_REALNAME='realname' | |
| BZ_SERVER_NAME='bz4.localhost' | |
| BZ_URLBASE='http://bz4.localhost/' | |
| BZ_APACHE_GROUP='www-data' | |
| BZ_INSTALL_PATH='/home/bugzilla/public_html/bugzilla' |
| #!/usr/bin/env perl | |
| use Mojolicious::Lite; | |
| use File::Slurp; | |
| use URI; | |
| use Digest::SHA1 qw/sha1_hex/; | |
| use File::Path qw/make_path/; | |
| use Cwd; | |
| # Documentation browser under "/perldoc" | |
| plugin 'PODRenderer'; |
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use URI; | |
| use Digest::SHA1 qw/sha1_hex/; | |
| use File::Path qw/make_path/; | |
| my %hook; | |
| my @repo = @ARGV or die "Usage: $0 <repo>..\n"; |
| [ | |
| "redisBrain", | |
| "help", | |
| "roles", | |
| "ascii", | |
| "ping", | |
| "uptime", | |
| "tweet", | |
| "shorten" | |
| ] |
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| my $str = $ARGV[0] or die "usage: $0 <string>\n"; | |
| my $LOWER_BEGIN = ord('a'); | |
| my $LOWER_END = ord('z'); | |
| my $UPPER_BEGIN = ord('A'); | |
| my $UPPER_END = ord('Z'); |
| use strict; | |
| use warnings; | |
| use DateTime::Format::ISO8601; | |
| my $str = '15:36:08 UTC Fri Oct 12 2012'; | |
| my @date = split / /, $str; | |
| my %MMAP = ( | |
| Oct => '10', | |
| ); |
| [Thu Sep 06 2012 10:04:21 GMT+0900 (KST)] ERROR Unable to call the listener: TypeError: Cannot read property 'time' of undefined | |
| TypeError: Cannot read property 'time' of undefined | |
| at makeBody (/home/hshong/repo/hubot-scripts/src/scripts/standup-yammer.coffee:59:28) | |
| at postYammer (/home/hshong/repo/hubot-scripts/src/scripts/standup-yammer.coffee:33:14) | |
| at Brain.module.exports.robot.respond.group (/home/hshong/repo/hubot-scripts/src/scripts/standup-yammer.coffee:6:14) | |
| at Brain.EventEmitter.emit (events.js:98:17) | |
| at nextPerson (/home/hshong/repo/hubot-scripts/src/scripts/standup.coffee:135:19) | |
| at TextListener.module.exports.robot.respond._ref [as callback] (/home/hshong/repo/hubot-scripts/src/scripts/standup.coffee:58:16) | |
| at TextListener.Listener.call (/home/hshong/hubot/node_modules/hubot/src/listener.coffee:19:14) | |
| at Robot.receive (/home/hshong/hubot/node_modules/hubot/src/robot.coffee:108:33) |