Apify avatar

Apify

Pricing

Pay per usage

Go to Apify Store
Apify

Apify

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Kevin Doshi

Kevin Doshi

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

Facebook Bright Data mirror — Apify Actor

Location: ~/apify-facebook-brightdata-mirror (home folder में नया project).

यह Actor क्या करता है?

  1. Apify platform पर चलने वाला छोटा Node.js प्रोग्राम है (Docker image में pack होकर)।
  2. Tech stack: apify npm package (Apify SDK v3) — Actor.init()getInput()pushData()exit()
  3. Dataset में हर item का shape वही है जो आपके backend में social-buzzbrand-api/src/crons/facebook.js Bright Data snapshot के बाद .map(post => …) से बनता है (lines ~251–287)।

यानी runApifyActor() जो items लौटाता है, वैसा ही structure — ताकि बाद में Bright Data की जगह इस Actor को plug किया जा सके।

Apify Actor कैसे काम करता है? (short)

PieceRole
Dockerfileapify/actor-node:20 image — Node + Apify runtime
.actor/actor.jsonActor name, version, Dockerfile path, input schema
src/main.jsEntry — Apify SDK calls
Actor.pushData(obj)हर object default dataset में एक row की तरह जाता है (API में listItems() वही पढ़ता है)
InputConsole / API से JSON — INPUT_SCHEMA से form बनता है

Docs: Actor definition, JS SDK.

Output — हर dataset item में fields (facebook.js mapping के अनुसार)

FieldSource (Bright Data raw)
feedback_idpost.post_id
post_url, top_level_urlpost.url
textpost.content
likespost.likes या count_reactions_type sum
commentspost.num_comments
sharespost.num_shares
video_viewspost.video_view_count
timestampIST-adjusted unix seconds (string)
date_postedpost.date_posted
mediapost.attachments[] → Graph-like objects
page_namepage_name / user_username_raw
facebook_idprofile_id
page_info.*page_followers, page_logo, …

पूरा mapping कोड: src/normalize.js (comments में line-by-line reference)।

Local चलाना

cd ~/apify-facebook-brightdata-mirror
npm install
npx apify-cli run

नतीजा: storage/datasets/default/*.json में items।

बिना Apify CLI: node src/test-normalize.js — सिर्फ normalize JSON print (SDK नहीं)।

Input options

  • mockData: true (default) — 2 sample Bright Data–like rows normalize करके dataset में भेजता है (shape test के लिए)।
  • rawPosts: [...] — Bright Data export के objects का array; सिर्फ normalize + push (कोई live scrape नहीं)।
  • mockData: false और rawPosts खाली — error: real FB scrape इस template में implement नहीं; आगे Crawlee + Playwright जोड़ सकते हो (Apify की usual stack)।

Apify पर upload / GitHub

  1. Apify Console → account
  2. Install CLI: npm i -g apify-cli (या npx apify-cli)
  3. apify login
  4. Project folder से: apify push (या GitHub repo connect करके auto-build)

.actor/actor.json में name / version अपडेट करके push करो।

असली Facebook scraping

Facebook पर aggressive scraping ToS / technical blocks के अधीन है। Production में अक्सर:

  • Crawlee (crawlee package) + Playwright — Apify official stack
  • या वही Bright Data dataset जो आप पहले से use कर रहे हो — इस Actor में rawPosts पास करके सिर्फ एक ही response format guarantee करो

इस repo का मुख्य उद्देश्य: एक ही normalized output contract + Apify पर deploy करने लायक skeleton।

GitHub (doshikevin361/apify)

Local repo में main branch commit तैयार है। Push इस मशीन पर login न होने से यहाँ से नहीं हुआ — अपने PC पर:

cd ~/apify-facebook-brightdata-mirror
git remote -v # origin → https://github.com/doshikevin361/apify.git
git push -u origin main

GitHub login: PAT (Settings → Developer settings) या gh auth login, या SSH (git remote set-url origin git@github.com:doshikevin361/apify.git).

फिर Apify Console → Link repositorydoshikevin361/apify → build।