Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin fetching data periodically #49

Open
Ponf opened this issue Jan 14, 2015 · 1 comment
Open

Plugin fetching data periodically #49

Ponf opened this issue Jan 14, 2015 · 1 comment

Comments

@Ponf
Copy link

Ponf commented Jan 14, 2015

I have ruby script, which runs as daemon and fetches some data from internet every 60 seconds, and posts messages in our channel using HipChat's url hook.
I want to move this logic into robut plugin, but all plugins in samples triggered by messages. Can you please provide sample, which will post any message into channel every N seconds starting from robut launch?

@justinweiss
Copy link
Owner

There’s not a great way to do it through the plugin architecture — Robut wasn’t really designed for that kind of thing. But since the Chatfile is just Ruby, you could spin up a thread that could manually send a message every few seconds.

I don’t have any examples of it at hand, but the robut-rdio plugin (https://github.com/radamant/robut-rdio https://github.com/radamant/robut-rdio) does start a Sinatra server from the Chatfile.

The trickiest part is going to be actually sending the message. But I think you could just do it in a similar way to how the plugin architecture sends and receives messages.

On Jan 14, 2015, at 11:42 AM, Filipp Panfilov notifications@github.com wrote:

I have ruby script, which runs as daemon and fetches some data from internet every 60 seconds, and posts messages in our channel using HipChat's url hook.
I want to move this logic into robut plugin, but all plugins in samples triggered by messages. Can you please provide sample, which will post any message into channel every N seconds?


Reply to this email directly or view it on GitHub #49.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants