Merged good suggestions from pixelbeat_

This commit is contained in:
Kai Hendry
2011-11-16 04:21:30 +00:00
parent 055a6e5793
commit e401ae0207
4 changed files with 20 additions and 21 deletions

View File

@@ -3,12 +3,11 @@ function grep(query) {
$.getJSON("/u/" + NAME + "/grep.php?q=" + query + "&jsoncallback=?", function(data) {
var results = "<p>Searched for: " + query + "</p><ol>";
for (i in data) {
// TODO, fix bug: https://twitter.com/#!/pixelbeat_/status/5120018968
tweet = data[i].split('|');
if (tweet.length > 2) {
results += "<li><a href=\"http://twitter.com/" + NAME + "/status/" + tweet[0] + "\">" + tweet[2] + "</a></li>"; // With datetime
results += "<li><a href=\"http://twitter.com/" + NAME + "/status/" + tweet[0] + "\">" + tweet.slice(2) + "</a></li>"; // With datetime
} else {
results += "<li><a href=\"http://twitter.com/" + NAME + "/status/" + tweet[0] + "\">" + tweet[1] + "</a></li>"; // Old style
results += "<li><a href=\"http://twitter.com/" + NAME + "/status/" + tweet[0] + "\">" + tweet.slice(1) + "</a></li>"; // Old style
}
}
$('#results').prepend(results + "</ol>");