AJAXy Timeline (e.g. election.twitter.com)


#1

I’m using the Prototype helper “periodically_call_remote” to add a new
item to a list similar to how http://election.twitter.com works.

My question is, how do I make it so that periodically_call_remote will
only add items that it hasn’t already added? The remote action is
querying the database for new records, but it pulls all records that
have been created since the page was originally loaded not the last
time the periodically_call_remote fired. So, it adds the same new
items every time it is called.

I have a few ideas about how to make this work, but none of them seem
ideal. I’m sure this is a pretty common problem, and someone has
already solved this.

Any ideas? Links? Suggestions?

TIA,

Donnie


#2

On Fri, Oct 24, 2008 at 8:45 AM, Donnie removed_email_address@domain.invalid wrote:

My question is, how do I make it so that periodically_call_remote will
only add items that it hasn’t already added? The remote action is
querying the database for new records, but it pulls all records that
have been created since the page was originally loaded not the last
time the periodically_call_remote fired.

How does the action know when the page in question was loaded?

Sounds like there’s a parameter being passed to define “more recent
than X”, and that needs to be updated. Just a WAG :slight_smile:

FWIW,

Hassan S. ------------------------ removed_email_address@domain.invalid