Issue #2 : Special Chars getting butchered#10
Open
sebastiendb wants to merge 1 commit intoarrix:masterfrom
Open
Issue #2 : Special Chars getting butchered#10sebastiendb wants to merge 1 commit intoarrix:masterfrom
sebastiendb wants to merge 1 commit intoarrix:masterfrom
Conversation
Before :
Readability: ---DOM created
Braquage cette nuit � Saint-Pierre <div id="corps"><p><p>Deux hommes, arriv�s � bord d’un scooter, ont fait irruption cette nuit vers 3h30 chez un marchand de fruits et l�gumes ouvert 24h/24 � Saint-Pierre. Ils auraient alors menac� d’une arme � feu le g�rant en r�clamant la caisse. Mais ne seraient repartis qu’avec la balance, croyant sans doute qu’elle pouvait contenir de l’argent. Pour le magasin, le pr�judice �conomique est donc plut�t l�ger. Mais si personne n’a �t� bless�, le braqu� est �videmment choqu�.</p>
After:
Readability: ---DOM created
Braquage cette nuit à Saint-Pierre <div id="corps"><p><p>Deux hommes, arrivés à bord d’un scooter, ont fait irruption cette nuit vers 3h30 chez un marchand de fruits et légumes ouvert 24h/24 à Saint-Pierre. Ils auraient alors menacé d’une arme à feu le gérant en réclamant la caisse. Mais ne seraient repartis qu’avec la balance, croyant sans doute qu’elle pouvait contenir de l’argent. Pour le magasin, le préjudice économique est donc plutôt léger. Mais si personne n’a été blessé, le braqué est évidemment choqué.</p>
<p><strong>Plus d’informations demain dans votre Journal de l’île.</strong></p></p></div>
if you use request (from mikeal for example), you will just have to do this :
var readability = require('../lib/readability');
var url = "http://www.clicanoo.re/322520-braquage-cette-nuit-a-saint-pierre.html";
var request = require('request');
request({url:url, 'encoding':'binary'}, function (error, response, html) {
var content_type = response['headers']['content-type'].split('=');
var encoding = content_type[1].toUpperCase();
if (!error && response.statusCode == 200) {
readability.parse(html, url, {encoding:encoding}, function(result) {
console.log(result.title, result.content);
});
}
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before :
After:
if you use request (from mikeal for example), you will just have to do this :
We can make this work without use my modification but i will help maybe some users to have this handled in node-readability.