Socket
Socket
Sign inDemoInstall

feedparser

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feedparser - npm Package Compare versions

Comparing version 0.19.0 to 0.19.1

examples/compressed.js

43

examples/iconv.js

@@ -25,26 +25,7 @@ /**

req.on('response', function(res) {
var stream = this
, iconv
, charset;
if (res.statusCode != 200) return this.emit('error', new Error('Bad status code'));
charset = getParams(res.headers['content-type'] || '').charset;
// Use iconv if its not utf8 already.
if (!iconv && charset && !/utf-*8/i.test(charset)) {
try {
iconv = new Iconv(charset, 'utf-8');
console.log('Converting from charset %s to utf-8', charset);
iconv.on('error', done);
// If we're using iconv, stream will be the output of iconv
// otherwise it will remain the output of request
stream = this.pipe(iconv);
} catch(err) {
this.emit('error', err);
}
}
var charset = getParams(res.headers['content-type'] || '').charset;
res = maybeTranslate(res, charset);
// And boom goes the dynamite
stream.pipe(feedparser);
res.pipe(feedparser);
});

@@ -62,2 +43,20 @@

function maybeTranslate (res, charset) {
var iconv;
// Use iconv if its not utf8 already.
if (!iconv && charset && !/utf-*8/i.test(charset)) {
try {
iconv = new Iconv(charset, 'utf-8');
console.log('Converting from charset %s to utf-8', charset);
iconv.on('error', done);
// If we're using iconv, stream will be the output of iconv
// otherwise it will remain the output of request
res = res.pipe(iconv);
} catch(err) {
res.emit('error', err);
}
}
return res;
}
function getParams(str) {

@@ -64,0 +63,0 @@ var params = str.split(';').reduce(function (params, param) {

v0.19.1 / 2014-07-31
==================
* Add compressed example
* Refactor iconv example
v0.19.0 / 2014-07-30

@@ -3,0 +9,0 @@ ==================

@@ -5,3 +5,3 @@ {

"description": "Robust RSS Atom and RDF feed parsing using sax js",
"version": "0.19.0",
"version": "0.19.1",
"keywords": [

@@ -8,0 +8,0 @@ "rss",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc