Skip to content

Commit

Permalink
Updated http-stream example to work, as reposrted in #11
Browse files Browse the repository at this point in the history
  • Loading branch information
disolovyov committed Feb 16, 2012
1 parent 3fe1cda commit 1b07cad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/http-stream.js
Expand Up @@ -4,7 +4,7 @@ var XmlStream = require('../lib/xml-stream');
// Request an RSS for a Twitter stream // Request an RSS for a Twitter stream
var request = http.get({ var request = http.get({
host: 'twitter.com', host: 'twitter.com',
path: '/statuses/user_timeline/301879799.rss' // @pandalog path: '/statuses/user_timeline/289849522.rss' // @dimituri
}).on('response', function(response) { }).on('response', function(response) {
// Pass the response as UTF-8 to XmlStream // Pass the response as UTF-8 to XmlStream
response.setEncoding('utf8'); response.setEncoding('utf8');
Expand All @@ -15,7 +15,7 @@ var request = http.get({
// Change <title> child to a new value, composed of its previous value // Change <title> child to a new value, composed of its previous value
// and the value of <pubDate> child. // and the value of <pubDate> child.
item.title = item.title.match(/^[^:]+/)[0] + ' on ' + item.title = item.title.match(/^[^:]+/)[0] + ' on ' +
item.pubDate.replace(/ +[0-9]{4}/, ''); item.pubDate.replace(/ \+[0-9]{4}/, '');
}); });


// When <item>'s <description> descendant text is completely parsed, // When <item>'s <description> descendant text is completely parsed,
Expand Down

0 comments on commit 1b07cad

Please sign in to comment.