Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
30
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

Organization

1日1回ゆどうふに HipChat でブログを書けと言うための hubot script

// Description:
//   Yudoufu blog notifier


module.exports = function (robot) {
  var msgs = [
    'ブログ書いた?',
    'ブログ...書いてょ(ヽ´ω`)',
    'ブログは?(*´ω`*)',
    '元気?',
    'ブログ更新したかな〜',
    'いつになったら...ブログ書いてくれるの?',
    '更新は今日かな? 明日かな? ((o(´∀`)o)) ',
  ];
  var room = "xxxxyour-room-idxxxx@conf.hipchat.com"

  var sendMsg = function () {
    var currentMessage = "@yudoufu " + msgs[Math.floor(Math.random() * msgs.length)];
    robot.messageRoom(room, currentMessage);
  };

  setTimeout(sendMsg, 1000*10);
  setInterval(sendMsg, 1000*86400);
}

こんなかんじになります:

スクリーンショット

たまに、気遣ってくれたりしてウケます:

気遣い

cron.js とか使うと、何かしらの notification にも使えるので、定例業務がある場合 (日報とか、週報とか?) にも応用効くし、なにげに便利。
あと messageRoom() メソッドの情報があまり転がってないので(ソース嫁ばわかるのだけど) ご参考にどうぞ。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
30
Help us understand the problem. What are the problem?