sanfrancesco / prerendercloud-lambda-edge

Pre-render CloudFront with this Lambda@Edge function. Powered by https://headless-render-api.com (formerly named prerender.cloud from 2016 - 2022)
https://headless-render-api.com
MIT License
206 stars 35 forks source link

Make prerender trigger on social media bots #7

Closed itsdax closed 6 years ago

itsdax commented 6 years ago

Single page appications will not have preview pictures when shared on any social media site.

Having prerendercloud trigger on these scraper bots would be great.

I'm currently using "botsOnly"=true

jotto commented 6 years ago

I'm not sure what all those icons are. What sites specifically did it not work at? I'll fix ASAP once I know.

The botsOnly list is here: https://github.com/sanfrancesco/prerendercloud-nodejs/blob/18a391a95fc3d81c63918f5bdf9307ffbd78bf48/source/index.js#L50

which includes FB, Reddit, and Pinterest, at least.

itsdax commented 6 years ago

I just put the icons for convenience of having a checklist of popular sites.

I'm not sure why facebook and pintest isn't triggering it since the useragents seem to all be there but I'll try narrowing it down more.

Suggestions to add: WhatsApp AdsBot-Google (https://support.google.com/webmasters/answer/1061943?hl=en) Mediapartners-Google (https://support.google.com/webmasters/answer/1061943?hl=en) Googlebot-Image (https://support.google.com/webmasters/answer/1061943?hl=en) Facebot (https://developers.facebook.com/docs/sharing/webmasters/crawler) Pinterestbot/1 (https://help.pinterest.com/en/articles/about-pinterest-crawler-0) pinterest.com/bot.html (https://help.pinterest.com/en/articles/about-pinterest-crawler-0) BingPreview (https://www.bing.com/webmaster/help/which-crawlers-does-bing-use-8c184ec0) Discordbot

jotto commented 6 years ago

The links are extremely helpful, thank you.

The list in the prerendercloud-nodejs is regex match, so considering that from your new list, I think I need to add:

Also send me a link to the page you're having trouble seeing previews for - support@prerender.cloud

itsdax commented 6 years ago

Worked out the issue, facebook wasn't grabbing the image on the first run, but second run works.

Not an issue with this library.