I managed to aggregate text and paste it in WordPress Content field. But I want to also add corresponding images of tweets after each entry. I find no option to get images from WordPress Content editor once
You can use ScrapeNinja (Real Browser) module to get the Tweet’s image URL with this setting:
Extractor function:
function (input, cheerio) {
let $ = cheerio.load(input);
return {
image: $('img[src^="https://pbs.twimg.com/card_img"]').attr('src')
}
}
Output, you get the extractor.result.image
Then you can use HTTP “Get a File” to download the image using the URL from the first module
For more info on how to set up ScrapeNinja, see https://scrapeninja.net. You need a https://rapidapi.com account.
3 Likes