NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
Updated : 2026-03-16
ObjServiceFacebook scrapes public Facebook page/profile posts
using the facebook_scraper library. It downloads post text,
timestamps, and images, then stores them in the data_newsfeed
table via the ObjNewsFeed base class.
facebook_scraper — optional; service degrades gracefully ifRuntimeError on use)requests — for image downloadsInstall: pip install facebook-scraper
settings:
max_posts: 25
pages_limit: 5
| Setting | Default | Description |
|---|---|---|
max_posts |
25 | Max posts to scrape per invocation |
pages_limit |
5 | Number of Facebook pages to paginate through |
Scrapes posts from a Facebook profile/page. Downloads post text,
timestamps, and images. Skips posts already in data_newsfeed
(dedup by shortcode/post_id). Returns the number of new posts
inserted.
Finds rows in data_newsfeed where feedhtml is NULL or empty
and regenerates it from feedtexl using the ObjNewsFeed HTML
processor (escapes HTML, bolds hashtags and mentions, wraps in
paragraphs).
Workflow entry point.
| Command | Context Keys | Result Key |
|---|---|---|
feed |
profile_name, max_posts (optional) |
_facebook_result |
backfill |
— | _facebook_result |
Legacy entry point. param1 = profile name, param2 = max posts.
| Method | Description |
|---|---|
_parse_timestamp(post_time) |
Convert datetime/string to "YYYY-MM-DD HH:MM:SS" |
_download_image(image_url, guid) |
Download post image to local.documents/facebook/ |
Posts are stored in data_newsfeed via the ObjNewsFeed base
class methods:
insert_new_feed_item() — insert a new postitem_exists(shortcode) — check for duplicates_process_feed_text_to_html() — convert plain text to HTMLImages are saved to {local_folder}/facebook/facebook_{guid}.jpg.
# Scrape posts from a Facebook page
python ObjServiceFacebook.py feed "TechnoCore" --max-posts 10
# Backfill missing HTML for existing posts
python ObjServiceFacebook.py backfill
from ObjServiceFacebook import ObjServiceApi
svc = ObjServiceApi()
count = svc.download_feed("TechnoCore", max_posts=10)
print(f"Scraped {count} new posts")
svc.backfill_html()
Updated : 2026-03-16