Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Procfile
README.md
package.json
web.js

README.md

在 Heroku 上面跑一隻 IRC 機器人

環境建立法:

  1. git clone git://github.com/ronnywang/heroku-ircbot.git
  2. cd heroku-ircbot
  3. git remote add heroku git@heroku.com:your-ircbot-app.git
  4. heroku config:set IRC_HOST=irc.freenode.net IRC_USER=your_bot_nick IRC_CHANNELS=#your_channel_1,#your_channel_2 SECRET=your_secret
  5. git push heroku master

這樣子就建立好環境了, 如果到 http://your-irc-app.herokuapp.com/ 裡面有看到 error 就表示成功了

PHP Sample:

<?php
$now = time();
$message = 'Your Message';
$channel = '#your_channel_1';
$secret = 'your_secret';

$sig = md5($message . $secret . $now . $channel);
$url = 'http://your-ircbot-app.herokuapp.com/?message=' . urlencode($message) . '&channel=' . urlencode($channel) . '&timestamp=' . $now . '&sig=' . urlencode($sig)
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_exec($curl);
curl_close($curl);
You can’t perform that action at this time.