One Deal at a Time Countodown Clock

by emdubl
6 replies
Hi,

I've just created my own daily deal and one deal at a time site. I've able to dynamically pull the deals from the affiliate site and display them ok (avantlink). I've also figured out a little bit of ajax code to refresh some of deals every few minutes.. seems to be working well.

But does anyone know how to code a real time countdown of when the deal is going to end? I've seen some other deal aggregator sites that do it. I'm just wondering where they get the actual countdown info - as I dont see it in the feed info being returned from avantlink.. Then I guess I dont really know how to code the actual countdown clock and refresh at end of countdown.

Are there available scripts out there? My current site is in my signature.

Thanks.
#clock #countodown #deal #time
  • Profile picture of the author mamchenkov
    There is really no need to do AJAX calls to update countdowns. If you know the time when the deal will expire, you can use that to do a simple JavaScript countdown in the client's browser. Especially if you show several deals with countdowns on the same page, it's better for your server to have it this way.

    There are plenty of JavaScript countdown scripts on the web. I am new on the forum and still can't post links directly, but if you google for "javascript countdown timer" you'll find a few.
    Signature

    Leonid Mamchenkov
    http://mamchenkov.net

    {{ DiscussionBoard.errors[4595391].message }}
  • Profile picture of the author wayfarer
    I don't have time to work out the exact logic, but the key is JavaScript's setInterval() function, along with using the system's time clock to accurately gauge time. See this tutorial to see how JavaScript can interact with your computer's time clock: Javascript Tutorial - Date
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[4595452].message }}
    • Profile picture of the author emdubl
      thanks guys.

      I've investigated it further and the affiliate feed from avantlink doesnt actually even give you an expiration date for each deal as far as I can tell - i've also confirmed this with someone at avantlink.

      so the sites that are showing countdowns must be scraping the actual countdown directly from the individual merchant sites and then displaying their own countdown based off of what they can pull from the merchant. at least i'm guessing that they are doing something like that.
      {{ DiscussionBoard.errors[4715282].message }}
  • Profile picture of the author mraffiliate
    Originally Posted by emdubl View Post

    Hi,

    I've just created my own daily deal and one deal at a time site. I've able to dynamically pull the deals from the affiliate site and display them ok (avantlink). I've also figured out a little bit of ajax code to refresh some of deals every few minutes.. seems to be working well.

    But does anyone know how to code a real time countdown of when the deal is going to end? I've seen some other deal aggregator sites that do it. I'm just wondering where they get the actual countdown info - as I dont see it in the feed info being returned from avantlink.. Then I guess I dont really know how to code the actual countdown clock and refresh at end of countdown.

    Are there available scripts out there? My current site is in my signature.

    Thanks.
    Nice site. Mind sharing if you are making any commissions, traffic stats, etc.? thanks
    Signature

    {{ DiscussionBoard.errors[4880975].message }}
  • Profile picture of the author TheGP
    If i understand ur post right and u want to create that - after all - wont forget cookies. When countdown finished - u can set cookies and if user will try go back on page with special offer - you check cookies and display that deal finished.

    Its just easiest protection, but many countdowns easy to refresh just by press F5 Thats stupid i think.

    Good luck with ur task
    {{ DiscussionBoard.errors[4881938].message }}
  • Profile picture of the author kdavies
    Hi

    I'll be happy to help you with this issue as I have alot of experience with ajax and have created countdown timers for a dutch-auction site.

    http://www.warriorforum.com/warriors...rogrammer.html

    Kind regards

    Kevin
    {{ DiscussionBoard.errors[4889098].message }}

Trending Topics