I'd like to fetch images from external website to show them next to users post (similiar to facebook).
I'm doing app on Parse.com cloud hosting (it uses modified Express.js framework)
There is a php version of the task External Url get Image
How do i get urls of images from base url with Express.js/Node.js
You can accomplish this with something like request
and cheerio
. For example:
var request = require('request'),
cheerio = require('cheerio');
request(url, function(err, res, body) {
if (err)
throw err;
var $ = cheerio.load(body);
$('img').each(function(img) {
console.log($(img).attr('src'));
});
});