| author | Raphael Velt <raph.velt@gmail.com> |
| Tue, 13 Dec 2011 19:01:59 +0100 | |
| changeset 406 | 86b62b98fea7 |
| permissions | -rw-r--r-- |
|
406
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
1 |
function connectTweets() { |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
2 |
$.getJSON('http://' + document.location.hostname + ':8888/?callback=?', function(data) { |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
3 |
loadTweets(data.tweets) |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
4 |
} ); |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
5 |
|
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
6 |
setInterval(function() { |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
7 |
if (!twCx.tweets) { |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
8 |
return; |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
9 |
} |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
10 |
$.getJSON('http://' + document.location.hostname + ':8888/?after_id=' + twCx.tweets[twCx.tweets.length - 1].id + '&callback=?', function(data) { |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
11 |
loadTweets(data.tweets, true); |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
12 |
}); |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
13 |
}, 1000) |
|
86b62b98fea7
Polemic Tweet client now uses rv's live system
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
14 |
} |