Commit 760c463e authored by yPhil's avatar yPhil
Browse files

New IMG detection routine, before a big cleanup of this mess

parent 9eda3136
......@@ -260,6 +260,9 @@ PTL.feed = {
$.each(data.feedItems, function(index, item) {
// PTL.util.console('PLOP', 'warning');
if (index == parseInt(feedLimit)) return false;
// console.log('i: (%s)', JSON.stringify(item));
......@@ -326,7 +329,15 @@ PTL.feed = {
}
if (typeof item.enclosures[0] !== 'undefined' && item.enclosures[0].url) {
if (!imageUrl && imgTypes.indexOf(item.enclosures[0].type) > -1) {
if (item.enclosures[0].url && item.enclosures[0].url.endsWith(".jpg")) {
console.log('Wopop on %s!: (%s) imageUrl: %s', feedUrl, item.enclosures[0].url, imageUrl);
imageUrl = item.enclosures[0].url;
}
if (imgTypes.indexOf(item.enclosures[0].type) > -1) {
imageUrl = item.enclosures[0].url;
}
......
......@@ -117,7 +117,7 @@ function getFeed (urlfeed, callback) {
})
.on ('error', function (err) {
var meta = this.meta;
console.log('HUM (%s)', err, meta.title);
console.log('HUUM (%s) %s %s', err, meta.title, urlfeed);
// callback ('err');
})
.on ('end', function () {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment