Skip to content

Commit

Permalink
+ Update title and header
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarlson committed Aug 29, 2010
1 parent c50c25f commit 31ada03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions nodelay.js
Expand Up @@ -87,11 +87,12 @@ function processEdit(data) {

// Update user count
usercountel = document.getElementById('updates');
var usercounttext = commaSeparated(edit.usercount) + ' user' + (edit.usercount == 1 ? '' : 's') + ' from ' + commaSeparated(edit.uniqueips) + ' unique address' + (edit.uniqueips == 1 ? '' : 'es');
var usercounttext = commaSeparated(edit.usercount) + ' user' + (edit.usercount == 1 ? '' : 's')
var uniqueiptext = ' from ' + commaSeparated(edit.uniqueips) + ' unique address' + (edit.uniqueips == 1 ? '' : 'es');
var editcounttext = commaSeparated(edit.editcount) + ' edit' + (edit.editcount == 1 ? '' : 's');
var userstring = 'Nodelay has ' + usercounttext + ' and has served ' + editcounttext + '!';
var userstring = 'Nodelay has served ' + editcounttext + ' to ' + usercounttext + uniqueiptext + '!';
usercountel.innerHTML = userstring;
top.document.title = userstring;
top.document.title = usercounttext + ' online now';

var queryurl = document.location.search;
// Update languages table
Expand Down
4 changes: 2 additions & 2 deletions server.js
Expand Up @@ -170,7 +170,7 @@ var lookInGoogle = function(returnobj, callback) {
var clientip = uniqueips[Math.floor(Math.random() * uniqueips.length)]
//console.log('found clientip', clientip, uniqueips);
var url = "/ajax/services/search/web?v=1.0&key=ABQIAAAANJy59z-JG5ojQlRVP3myHBQazc0JSD0GCdkBcD0H4asbApndtBRNVqQ4MvCnn6oQF6lHyWk4Q9S5AA&userip=" + clientip + "&q='" + querystring.escape(title) + "'";
console.log('google request', url);
//console.log('google request', url);

var request = googleclient.request('GET', url, {'host': 'ajax.googleapis.com','referer': 'http://code.google.com/apis'})
request.end()
Expand All @@ -186,7 +186,7 @@ var lookInGoogle = function(returnobj, callback) {

// process when the response ends
response.on('end', function () {
console.log('parsing: ' + url + ' for chunk ' + responsedata)
//console.log('parsing: ' + url + ' for chunk ' + responsedata)
try {
var data = JSON.parse(responsedata)
if (data.responseData && data.responseData.results) {
Expand Down

0 comments on commit 31ada03

Please sign in to comment.