{"id":20357866,"url":"https://github.com/gandi/hubot-cron-events","last_synced_at":"2025-04-12T03:14:51.440Z","repository":{"id":57268793,"uuid":"65444330","full_name":"Gandi/hubot-cron-events","owner":"Gandi","description":"A hubot plugin to perform generic event emission scheduled using cron job.","archived":false,"fork":false,"pushed_at":"2016-09-03T18:56:51.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-12T03:14:48.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gandi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-11T06:26:35.000Z","updated_at":"2017-08-12T12:42:12.000Z","dependencies_parsed_at":"2022-09-02T02:50:28.284Z","dependency_job_id":null,"html_url":"https://github.com/Gandi/hubot-cron-events","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fhubot-cron-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fhubot-cron-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fhubot-cron-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fhubot-cron-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gandi","download_url":"https://codeload.github.com/Gandi/hubot-cron-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248510001,"owners_count":21116130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T23:24:13.508Z","updated_at":"2025-04-12T03:14:51.425Z","avatar_url":"https://github.com/Gandi.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hubot Cron Events Plugin\n=================================\n\n[![Version](https://img.shields.io/npm/v/hubot-cron-events.svg)](https://www.npmjs.com/package/hubot-cron-events)\n[![Downloads](https://img.shields.io/npm/dt/hubot-cron-events.svg)](https://www.npmjs.com/package/hubot-cron-events)\n[![Build Status](https://img.shields.io/travis/Gandi/hubot-cron-events.svg)](https://travis-ci.org/Gandi/hubot-cron-events)\n[![Dependency Status](https://gemnasium.com/Gandi/hubot-cron-events.svg)](https://gemnasium.com/Gandi/hubot-cron-events)\n[![Coverage Status](https://img.shields.io/codeclimate/coverage/github/Gandi/hubot-cron-events.svg)](https://codeclimate.com/github/Gandi/hubot-cron-events/coverage)\n[![NPM](https://nodei.co/npm/hubot-cron-events.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/hubot-cron-events/)\n\nThis plugin is a generic event emitter scheduled using cron job. It's very similar to [hubot-cron](https://github.com/miyagawa/hubot-cron), but instead of sending messages it emits events.\n\nThis plugin can be very handy when combined with other plugins that will receive the emitted events.\n\nThere is another similar plugin named [hubot-at-events](https://github.com/Gandi/hubot-at-events) that applies the same principle for one-time actions at given dates.\n\nInstallation\n--------------\nIn your hubot directory:    \n\n    npm install hubot-cron-events --save\n\nThen add `hubot-cron-events` to `external-scripts.json`\n\n\nConfiguration\n-----------------\n\nIf you use [hubot-auth](https://github.com/hubot-scripts/hubot-auth), the cron configuration commands will be restricted to user with the `admin` role. \n\nBut if hubot-auth is not loaded, all users can access those commands.\n\nIt's also advised to use a brain persistence plugin, whatever it is, to persist the cron jobs between restarts.\n\n\nCommands\n--------------\n\nCommands prefixed by `.cron` are here taking in account we use the `.` as hubot prefix, just replace it with your prefix if it is different.\n\n    .cron version\n        gives the version of the hubot-cron-events package loaded\n\n    .cron \u003cname\u003e \u003cperiod\u003e \u003ceventname\u003e\n    .cron \u003cname\u003e \u003cperiod\u003e \u003ceventname\u003e \u003ctz\u003e\n    .cron \u003cname\u003e \u003cperiod\u003e \u003ceventname\u003e [\u003ctz\u003e] with param1=value1\n    .cron \u003cname\u003e \u003cperiod\u003e \u003ceventname\u003e [\u003ctz\u003e] with param1=value1 param2=value2\n    .cron \u003cname\u003e \u003cperiod\u003e \u003ceventname\u003e [\u003ctz\u003e] with param1=long value with spaces param2=value2\n        will create or update a job with unique identifier \u003cname\u003e\n        the \u003cperiod\u003e has to match a valid cronjob syntax of type * * * * *\n        if 6 items are provided (ie. * * * * * *), the first one will be the seconds\n        the optional \u003ctz\u003e will be applied if provided\n        if no eventname is provided, the job will not emit anything\n\n        This also can be used to modify an existing job.\n        If the tz and data are omitted they will not be changed\n\n        Data params can be provided if you add 'with' and a list\n        of attributions. There is a drawback, which is that in the\n        current implementation, the values can't contain an equal sign ('=')\n\n        example:\n        .cron blah */5 * * * * * cron.message\n            will emit a cron.message every 5 seconds\n            that event requires 2 data params, room and message:\n            .cron blah room = shell\n            .cron blah message = tick tack\n        or\n        .cron blah */5 * * * * * cron.message with room=shell message=tick tack\n        .cron start blah\n            activates the job, which will run every 5 seconds\n        .cron blah * * * * * \n            modifies the job blah to run every minutes instead\n            and it will emit the same event cron.message\n            and it will keep the already set data\n            note that modifying a job stops it, \n            so it has to be restarted afterward\n        .cron start blah\n            now the job is active and will run every minute\n\n    .cron status \u003cname\u003e\n        tells if the job is running or paused\n\n    .cron info \u003cname\u003e\n    .cron show \u003cname\u003e\n        gives the details about a job\n\n    .cron list [\u003cterm\u003e]\n        lists all the jobs, or only the jobs with names matching \u003cterm\u003e\n\n    .cron stop \u003cname\u003e\n    .cron pause \u003cname\u003e\n        stops the job \u003cname\u003e\n\n    .cron start \u003cname\u003e\n    .cron resume \u003cname\u003e\n        starts the job \u003cname\u003e\n\n    .cron delete \u003cname\u003e\n        delete the job \u003cname\u003e\n\n    .cron \u003cname\u003e \u003ckey\u003e = \u003cvalue\u003e\n        sets a key-value pair in the job data\n        if the key already exists, its value will be changed\n        if you change the data for job that is currently running\n        it will be stopped and restarted \n    \n    .cron \u003cname\u003e drop \u003ckey\u003e\n        removes a key-value pair form the job data\n        this will also restart the job if it's running\n\nSome events receivers are also provided for testing purposes:\n\n    cron.message\n        requires data:\n        - room\n        - message\n        it will just say the message in the given room\n\n    cron.date\n        requires data:\n        - room\n        it will tell the date on the room\n\nTesting\n----------------\n\n    npm install\n\n    # will run make test and coffeelint\n    npm test \n    \n    # or\n    make test\n    \n    # or, for watch-mode\n    make test-w\n\n    # or for more documentation-style output\n    make test-spec\n\n    # and to generate coverage\n    make test-cov\n\n    # and to run the lint\n    make lint\n\n    # run the lint and the coverage\n    make\n\nChangelog\n---------------\nAll changes are listed in the [CHANGELOG](CHANGELOG.md)\n\nContribute\n--------------\nFeel free to open a PR if you find any bug, typo, want to improve documentation, or think about a new feature. \n\nGandi loves Free and Open Source Software. This project is used internally at Gandi but external contributions are **very welcome**. \n\nAuthors\n------------\n- [@mose](https://github.com/mose) - author and maintainer\n\nLicense\n-------------\nThis source code is available under [MIT license](LICENSE).\n\nCopyright\n-------------\nCopyright (c) 2016 - Gandi - https://gandi.net\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgandi%2Fhubot-cron-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgandi%2Fhubot-cron-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgandi%2Fhubot-cron-events/lists"}