# Facebook Posts

<p class="lede">Live posts from Facebook, embedded natively through Meta's oEmbed API — the same
rendered card you'd see on Facebook, framed in BP Music styling. How to add one is documented at
the bottom.</p>

---

## A post from the road

<div class="fb-embed" data-fb-post="https://www.facebook.com/kennywayneshepherd/posts/1462031878614544"></div>

## What a dead post looks like

Private, deleted, or not-yet-fetched posts never leave a hole in the page — the renderer swaps in
a branded card that still links to Facebook:

<div class="fb-embed" data-fb-post="https://www.facebook.com/someone/posts/999999999999999"></div>

---

## Adding a Facebook post to any page

1. Grab the post's **canonical URL** from Facebook (right-click the post's timestamp → Copy link
   address). It looks like `https://www.facebook.com/<page>/posts/<numbers>`.
2. Add an embed slot to the Markdown — that's the whole markup:

   ```html
   <div class="fb-embed" data-fb-post="https://www.facebook.com/<page>/posts/<numbers>"></div>
   ```

3. Re-bake the embed data (needs Python 3, and network):

   ```
   python tools/fetch_facebook_posts.py "https://www.facebook.com/<page>/posts/<numbers>"
   ```

   Or add all your URLs to `tools/facebook-posts.txt`, one per line, and run
   `python tools/fetch_facebook_posts.py --file tools/facebook-posts.txt`.
   Public posts need **no token** (Meta's tokenless oEmbed). To pull a whole Page timeline, or to
   raise the hourly quota, set `FB_ACCESS_TOKEN` in your environment first — never in a file:

   ```
   FB_ACCESS_TOKEN=... python tools/fetch_facebook_posts.py --feed <page-id> --limit 5
   ```

4. Commit the regenerated `assets/data/facebook-posts.json` alongside the page. Static deploy as
   always — `git push` is the build.

<p class="meta-line">Embeds fetched via Meta Graph API oembed_post; posts render through
Facebook's own SDK, so cards always show live counts and “Like/Comment” actions.</p>
