...
 
Commits (2)
......@@ -15,13 +15,14 @@ module.exports = function(url, callback) {
'application/rss+xml',
'application/xhtml+xml'],
usualSuspects = [url + '/rss',
url + '.rss',
url + '/feed',
url + '/atom',
url + '/rss.xml',
url + '.rss',
url + './rss',
url + '/atom.xml',
url + '/feed.xml'];
url + '/feed.xml',
url + './rss'
];
if (!p.protocol) return callback(null, searchPrefix + url.split(' '));
......@@ -31,8 +32,8 @@ module.exports = function(url, callback) {
// console.log('whoa: (%s)');
for (let i = 0; i < usualSuspects.length; i++) {
does_it_render(usualSuspects[i], function(err, renders) {
// console.log('dir: (%s)', usualSuspects[i]);
if (renders) {
console.log('dir: (%s)', usualSuspects[i]);
feed = usualSuspects[i];
}
});
......
{
"name": "feedrat",
"version": "0.1.53",
"version": "0.1.54",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "feedrat",
"version": "0.1.53",
"version": "0.1.54",
"description": "Search, find and report a web page's RSS feed",
"main": "feedrat.js",
"license": "SEE LICENSE IN LICENSE",
......
......@@ -14,7 +14,7 @@ describe('feedrat', function() {
it('can find a feed from the usual suspects list', function(done) {
feedrat('https://www.reddit.com/r/news', function(err, url) {
if (err) return done(err);
url.should.be.oneOf('https://www.reddit.com/r/news.rss', 'https://www.reddit.com/r/news/.rss', 'https://www.reddit.com/r/news/feed.xml');
url.should.be.oneOf('https://www.reddit.com/r/news.rss', 'https://www.reddit.com/r/news/.rss', 'https://www.reddit.com/r/news.rss');
done();
});
});
......