Filter existing status with new ones

Oct 5, 2012 at 4:43 AM

If I make a call every 30 seconds for the latest status of a users home to get the status of their friends most recent post, and always pull the top 50, what do you suggest I do, or how should i approach filtering out existing ones already in the uses twitter box so that i do not add duplicates?

Should i do this by statusID and keep this in a collection on the server or should I push that responsibility to the client and do the filtering on the client?

Also, just wondering, how many statuses do you recommend that I keep on the client before I start deleting them? I've already got a heavy javascript program running. Everything seems to be fine for now, but what happens if the client stays on that one page for 5 hours, because this will be quite possible for this solution i'm bulding.

Oct 6, 2012 at 2:08 AM

For some reason it seems to be hard to nail down exactly how many request can be made, if it is once every 30 seconds or once every minute. Not sure if requesting a users favorites count the same as requesting home timelines.. If anyone has got a url that explains this clearly that would be great.

 

Im am using the statusID to resolve the issue with duplicates; however, every now and then it will send me a duplicate so I've added a little storeage on the client side and i wanted to post it for someone else if the need it.

I've trimmed up my code to represent to most relative info.

     
 var sinceID = 0,
            favsinceID = 0,
            statusidQ = {},
            favstatusidQ = {};
   //
    function twSuccess(data, status) {
        if (status.indexOf('error') > -1) { return; };
         // 
               var hm = data.home,
                i = 0,
                dfh = docFrag();
              //
            for (; i < hm.length; i += 1) {
                //
                if (!statusidQ[hm[i].StatusID]) {
                    dfh.addChild(makeStatus(hm[i]));
                    //Duplicate Check
                    statusidQ[hm[i].StatusID] = hm[i].StatusID;
                };
            };
            //
            sinceID = hm[0] && hm[0].StatusID || sinceID;
  };

Coordinator
Oct 6, 2012 at 3:33 AM

Hi,

I have a blog post on how to work with Twitter timelines with LINQ to Twitter:

http://geekswithblogs.net/WinAZ/archive/2012/09/02/working-with-timelines-with-linq-to-twitter.aspx

I think there's a sample in the downloadable source code too.

Joe