fffetch — Make sure your site is Facebook ready before Facebook
You just spent weeks/months building and coding a lovely new website. You’ve done everything to prepare for launch. Ran through the checklist of items needed, optimized images, fixed any 404s, ran through some ADA checks and prepped the DNS, set up redirects… etc.
The one thing you can’t prepare in advance for however is Open Graph sharing. The first thing any client/user will do is share your new website on Slack, Facebook, or Twitter. Whenever a user does this these services fetch data from that URL. This creates theshareable card that we’re all familiar with. However these services rarely prime a URL adequately on first fetch. Typically fetching data requires you to go through the facebook debugger in advance and requires fetching a specific URL multiple times in order to populate it enough for sharing to function as expected. This process can be especially tedious and time consuming if launching a website for the first time (potentially 100s or urls?), or refreshing an existing one.
Enter fffetch, a small service that takes a JSON feed of URLS and pushes them to the Facebook debugger. It uses the scrape-fb-ogcache package in the background to loop through urls and call a Facebook fetch.
In order to push the urls upload an site.json
file that includes an array of all the URLS you’d like facebook to fetch data for. The logger will report back per URL the results of each fetch. If some URLs are not prepared correctly it will return errors (and solutions).
Sample structure:
{
"urls": [
"https://thecouch.nyc",
"https://kevingreen.sucks"
]
}
And that’s that. Enjoy!