Ive got a live update twitter thing that i have been trying to build, i notice sometimes it duplicates tweets and goes a little bit nuts. Have i stuffed up somewhere in here?
Thanks in advance
(note i posted something similar before but removed it)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should define
pendingTweetsarray insidegetJSONcallback handler because it needs to be initialized to empty array every time you get new tweets.Working demo
After the first search
pendingTweetshas all the tweets from this call. Now in the next search you compare and add the add news tweets into this array you should empty it because you are looping through this array and building the markup.