0

An Parliament member in Israel has just removed an embarrassing FB post (you really don't want to know).

I've tossed a little Python+Selenium script based on this SO answer:

from selenium import webdriver
from PIL import Image
import datetime

filename = "miri_regev_"+datetime.datetime.now().strftime("%Y.%m.%d.%H:%M:%S")+".png"
fox = webdriver.Firefox()
fox.get('https://www.facebook.com/miri.regev.il')

fox.save_screenshot(filename) # saves screenshot of entire page
fox.quit()

However, running this script periodically is a waste of time and space. I would like to run it only when the FB publishes a new post or updates an existing one.

Is there a way to use FB Graph API to query for new posts on a public page?

Community
  • 1
  • 1
Adam Matan
  • 128,757
  • 147
  • 397
  • 562

1 Answers1

2

As mentioned in this answer to a similar question, you can get notifications of changes to a Facebook page using the Real-Time API. https://developers.facebook.com/docs/reference/api/realtime/

Community
  • 1
  • 1
Dikla
  • 56
  • 3