added images to androiddevelopers
This commit is contained in:
parent
11d0630850
commit
a626b34f8c
@ -227,6 +227,34 @@ function doAndroidDeveloper(body, url)
|
||||
tdihbody = cleaner(tdihbody);
|
||||
logger.debug(title);
|
||||
|
||||
urlObj = URL.parse(url);
|
||||
urlPrefix = urlObj.protocol + '//' + urlObj.host + '/';
|
||||
|
||||
try {
|
||||
tdihbody.find('IMG').each(function (i, elem) {
|
||||
let s, src = $(this).attr("src");
|
||||
|
||||
if (src !== null) {
|
||||
if (!STRING(src).startsWith('http')) {
|
||||
logger.debug('Stripping:' + src);
|
||||
src = urlPrefix + STRING(src).stripLeft('/').trim().s;
|
||||
}
|
||||
|
||||
if (typeof obj.thumbnail === 'undefined') {
|
||||
obj.thumbnail = src;
|
||||
}
|
||||
|
||||
s = 'http://image.silvrtree.co.uk/900,fit/' + src;
|
||||
|
||||
$(this).attr("src", s);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
logger.error(e);
|
||||
}
|
||||
|
||||
obj.url = STRING(url).trim().s;
|
||||
obj.html = $.html();
|
||||
obj.reduced = STRING(tdihbody.html()).trim().s;
|
||||
|
Loading…
Reference in New Issue
Block a user