<!--Load scripts for Facebook scraper-->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '154617751273927',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
What is meant by the use of the word “scraper” in the comment? This looks like an async function, and it’s http://connect.facebook.net/en_US/all.js
I am not sure what this al.js does. The result of that attached to the fb-root element.
What does this async function do and why is it called a “scraper”?
You have asked in your question-
I am not sure what this al.js doesActually
all.jsis theFacebook JavaScript SDK (Software Development Kit)a JavaScript file with all common options.What does this async function doThe
asyncfunction loads theSDK/all.jsfileasynchronouslywhich means it doesn’t stop the page rendering during the loading of that file.The SDK inserts elements into fb-root which expect to be positioned relative to the body or relative to an element close to the top of the page.
The function assigned to
window.fbAsyncInitis run as soon as the SDK is loaded. Any code that you want to run after the SDK is loaded should be placed within this function and after the call to FB.init.Why is it called a scraperA little about faceBook __scraper__ from my understandingActually, it can scrape data from the website (from your site, because you’ve used it/all.js) and can send that data to Facebook. Basically, one common example of this scraping is FaceBook
Likebutton on web pages. When a user clicks on the faceBook Like button the scraper (all.js in this case) scrape some data from that site and sends those data to the faceBook and FaceBook posts those data to the user’s profile but this is only one example. FaceBook scraper allows users to “Connect with Facebook” for an immersive and customized blog post or video experience. Users’ FB info such as name, age, location, profile picture, interests, etc., are scraped and weaved into a branded story.You can read more here.
On the web, some sites using
__scraper__also still data/content from good websites and posts into other websites by changing/modifying the original data. A few days ago I’ve found one of my SO answer on a different site and I really shocked. I’ve reported on meta about this, you may find it interesting.