Countdown timer, on timer complete

1,109 views
Skip to first unread message

Ryan W. Kan

unread,
Apr 9, 2014, 10:35:05 PM4/9/14
to fireba...@googlegroups.com
Hi guys,

Am scouring the net for examples on how this could be done, but came up blank.

What I am trying to do is to implement an auction system, so there needs to be a TIMER which COUNTS DOWN automatically, and sends out notifications to both party once the countdown is over.

Sending of notifications will be handled by Zapier, so that part is sorted.

Problematic part is counting down the timer, then sending a trigger to Zapier, whether the client is connected, or not.

Any ideas?

Cheers
Ryan

Michael Wulf

unread,
Apr 10, 2014, 12:38:06 AM4/10/14
to fireba...@googlegroups.com
First of all, you want to make the "countdown" process a client-side operation. The Firebase data should simply store the start/end times.

I wrote an example timer app a while back that should give you a good starting point: http://jsfiddle.net/katowulf/WEUZt/

The second component would be a server process to read the timers and trigger an event when the time is up (in your case, probably writing to a queue/trigger path where Zapier would read/remove events as it sends out the notifications. 

There's probably no getting around the server process for this portion. However, you could check out Zapier's Cron service. You might be able to rig some clever way to trigger the zapier notifications immediately, but send them to Cron, and then use the data from the firebase event to tell Cron how long to wait, and then have Cron trigger another event that fires the actual notification.

Cheers,
Kato




--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan W. Kan

unread,
Apr 10, 2014, 1:53:35 AM4/10/14
to fireba...@googlegroups.com
Thanks Kato! The cron idea is awesome! I'll look into it. Will post back with solution.

Cheers
Ryan

Michael Wulf

unread,
Apr 10, 2014, 5:54:27 PM4/10/14
to fireba...@googlegroups.com
Hey Ryan,

Was just looking at Zapier today for another issue. Looks like the service is called "Schedule" and it only does intervals like Daily/Weekly/et al and cannot be configured. Might want to ping them with your scenario and mention it; they are a pretty receptive group. But then I think you'll be back to the server script.

Cheers,
Reply all
Reply to author
Forward
0 new messages