hubot-cronjob

0.2.2 • Public • Published

hubot-cronjob

Hubot scriptable cron job.

It's just like miyagawa/hubot-cron, but controlled via source code instead of user-facing commands. If you wish to allow your users create cron jobs themselves, use that package.

Usage

An example that fetches restaurant menu every workday at 11am

HubotCron = require 'hubot-cronjob'
fetchRestaurantMenu = require 'my-restaurant-api'

module.exports = (robot) ->
  # monday to friday, 11am
  pattern = '0 11 * * 1-5'
  timezone = 'Europe/Prague'
  fn = fetchRestaurantMenu.bind null, (err, menu) ->
    if err
      return console.error err
    robot.messageRoom 'lunchroom', menu
  new HubotCron pattern, timezone, fn

How to install

npm install --save hubot-cronjob

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.2
    58
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.2
    58
  • 0.2.1
    0
  • 0.2.0
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i hubot-cronjob

Weekly Downloads

58

Version

0.2.2

License

MIT

Last publish

Collaborators

  • corkscreewe