// Replace YOUR_ACCESS_TOKEN with your Facebook access token
const ACCESS_TOKEN = "YOUR_ACCESS_TOKEN";
const PAGE_ID = "ecolesaintmartinchagny71";
const POSTS_LIMIT = 10;
// Construct the URL for the Facebook Graph API request
const url = `https://graph.facebook.com/${PAGE_ID}/posts?access_token=${ACCESS_TOKEN}&limit=${POSTS_LIMIT}`;
// Send a GET request to the Facebook Graph API
fetch(url)
.then(response => response.json())
.then(data => {
// Extract the posts from the response data
const posts = data.data;
// Log the posts in the console
console.log(posts);
})
.catch(error => {
console.error(error);
});