Comparing version 1.1.0 to 1.2.0
// Generated by CoffeeScript 1.6.3 | ||
module.exports = function(req, callback) { | ||
var async, candidates, favicon, htmlparser, parser, request, sitename, sitenameFlag, url; | ||
var async, candidates, csDetector, favicon, htmlparser, iconv, parser, request, sitename, sitenameFlag, url; | ||
htmlparser = require("htmlparser2"); | ||
csDetector = require("node-icu-charset-detector"); | ||
iconv = require('iconv'); | ||
async = require('async'); | ||
@@ -35,4 +37,7 @@ url = require('url'); | ||
}); | ||
return request(req, function(err, res, body) { | ||
var obj; | ||
return request.get({ | ||
uri: req, | ||
encoding: null | ||
}, function(err, res, body) { | ||
var charset, converter, obj; | ||
if (err != null) { | ||
@@ -43,2 +48,7 @@ callback(err, null); | ||
obj = url.parse(req); | ||
charset = csDetector.detectCharset(body).toString(); | ||
if (charset !== ('utf-8' || 'UTF-8')) { | ||
converter = new iconv.Iconv(charset, 'utf-8'); | ||
body = converter.convert(body).toString(); | ||
} | ||
parser.write(body); | ||
@@ -45,0 +55,0 @@ parser.end(); |
{ | ||
"name": "find-rss", | ||
"description": "find rss feeds", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"author": "nikezono", | ||
@@ -9,3 +9,5 @@ "dependencies": { | ||
"htmlparser2": "*", | ||
"request": "*" | ||
"request": "*", | ||
"node-icu-charset-detector": "*", | ||
"iconv": "*" | ||
}, | ||
@@ -12,0 +14,0 @@ "devDependencies": { |
@@ -35,1 +35,9 @@ node-find-rss [![Build Status](https://travis-ci.org/nikezono/node-find-rss.png)](https://travis-ci.org/nikezono/node-find-rss) | ||
url: 'http://images.apple.com/main/rss/hotnews/hotnews.rss' } ] | ||
##dependency | ||
node-find-rss uses [node-icu-charset-detector](https://github.com/mooz/node-icu-charset-detector),and require **livicu-dev** or **icu4c**. | ||
# ubuntu and debian-based systems | ||
apt-get install libicu-dev | ||
# os x | ||
port install icu +devel # with macports | ||
brew install icu4c && brew link icu4c # homebrew |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8671
82
43
5
6
+ Addediconv@*
+ Addednode-icu-charset-detector@*
+ Addediconv@3.0.1(transitive)
+ Addednan@2.20.0(transitive)
+ Addednode-icu-charset-detector@0.2.0(transitive)