Skip to content

Commit

Permalink
Fix theblaze
Browse files Browse the repository at this point in the history
  • Loading branch information
jarett-lee committed Jan 22, 2017
1 parent dfc78dc commit 96b499d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 12 additions & 6 deletions server/newsNetwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,18 @@ rssReader["motherjones"] = createGeneralReader([
['meta', 'image', 'url']
]);

// works very small image, sometimes no image
rssReader["theblaze"] = createGeneralReader([
['title'],
['link'],
['enclosures', 0, 'url']
]);
// idk
rssReader["theblaze"] = function functionName(node) {
var obj = createGeneralReader([
['title'],
['link'],
[]
])(node);

obj.link = 'http://www.theblaze.com/' + obj.link;

return obj;
}

// works very small image, sometimes no image
rssReader["huffingtonpost"] = createGeneralReader([
Expand Down
4 changes: 4 additions & 0 deletions server/newsServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ var newsNetwork = require("./newsNetwork.js");
var url = require("url");
var scraper = require("./scraper.js");

// newsNetwork.getCache('theblaze', function(out) {
// console.log(out);
// });

function randomInt(min, max) { // [min, max] not [min, max)
min = Math.ceil(min);
max = Math.floor(max);
Expand Down

0 comments on commit 96b499d

Please sign in to comment.