Changes to nodebb-plugin-rss in light of YQL shutdown
-
Hi Devs,
YQL service is down for good. See notice here: https://developer.yahoo.com/yql/
Let's make nodebb-plugin-rss work again!
Please consider the following changes to the plugin:
- In package.json add:
"rss-parser": "^3.6.2"
- In index.js: Add on the top:
var Parser = require('rss-parser');
- In index.js function pullFeeds: comment out var entry= and change as follows:
async.eachSeries(entries, function(entryObj, next) { //var entry = entryObj.entry; var entry = {title: entryObj.title, content: {content: entryObj.content}, published: entryObj.pubDate, link: {href: entryObj.link}, id: entryObj.guid, category: entryObj.categories} ;
- In index.js function getFeedByYahoo, comment out the entire request section, and replace with:
let parser = new Parser(); parser.parseURL(feedUrl, function(err, feed) { if(err) callback(err); callback(null, feed.items); });
Note, I did not take care of entriesToPull, however its trivial to truncate the feed array (I know, I am a bad boy and I should be spanked).
- In index.js function checkFeed, comment out var entryData =, and change as follows:
entries = entries.map(function (entry) { //var entryData = entry.entry || {}; var entryData = {title: entry.title, content: {content: entry.content}, published: entry.pubDate, link: {href: entry.link}, id: entry.guid, category: entry.categories} ;
That's it.
Note I had to disable "convert to markdown" so the images would display properly.Let me know should you have any questions,
JJ. -
Hi @baris,
As for markdown,
The following img link:
<a href="https://path_to_article"><img src="https://path_to_pic.jpg" alt="some_text" title="cool_title" width="some_number" height="another_number" class="img-responsive"></a>
Is converted to:
<a href="path_to_article" rel="nofollow">![null](link_to_picture "null")</a>
The issue stem from
toMarkdown = function (input, options) {...}
Fixing toMarkdown is a bit above my paygrade at the moment
Copyright © 2024 NodeBB | Contributors