App-RoboBot
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/App/RoboBot/Plugin/API/Github.pm view on Meta::CPAN
return;
}
sub get_repo_notices {
my ($self, $repo) = @_;
# Update repo with polled_at = now() - 10 seconds, so that every time we
# poll GH, we're actually looking at a window of length(watcher_interval)
# offset 10 seconds in the past. This gives events on the GH side of things
# time to propogate to their API endpoints, so we don't miss out.
my $poll_t = $self->bot->config->db->do(q{
update github_repos
set polled_at = now() - interval '10 seconds'
where repo_id = ?
returning to_char(polled_at at time zone 'UTC','YYYY-MM-DD"T"HH24:MI:SS"Z"') as polled_at
}, $repo->{'repo_id'});
return unless $poll_t && $poll_t->next;
my ($json, @notices);
lib/App/RoboBot/Plugin/API/Kegerator.pm view on Meta::CPAN
sub _run_watcher {
my ($self, $bot) = @_;
# TODO: Call base API path, get JSON
# TODO: Loop through keg list, compare each one's last_updated with the
# plugin's last_check attribute. Any with a new update should be
# added to a list of tap#->beerid
# TODO: If any tap#'s were marked as new, call the beer detail API endpoint
# to get beer name, ABV, IBU, etc.
# TODO: If any @output to send, construct a mock Response object for each
# plugin->notice[server+channel], and send notifications out.
# TODO: Update plugin's last_check timestamp.
$self->watcher(
AnyEvent->timer(
after => 30,
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.764 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )