Bridgy
📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
Install / Use
/learn @snarfed/BridgyREADME
<img src="https://raw.github.com/snarfed/bridgy/main/static/bridgy_logo_with_alpha.png" alt="Bridgy" width="128" /> Bridgy

Bridgy connects your web site to social media. Likes, reposts, mentions, cross-posting, and more. See the user docs for more details, or the developer docs if you want to contribute.
https://brid.gy/
Bridgy is part of the IndieWeb ecosystem. In IndieWeb terminology, Bridgy offers backfeed, POSSE, and webmention support as a service.
License: This project is placed in the public domain. You may also use it under the CC0 License.
Development
Pull requests are welcome! Feel free to ping me in #indieweb-dev with any questions.
First, fork and clone this repo. Then, install the Google Cloud SDK and run gcloud components install cloud-firestore-emulator to install the Firestore emulator. Once you have them, set up your environment by running these commands in the repo root directory:
gcloud config set project brid-gy
python3 -m venv local
source local/bin/activate
pip install -r requirements.txt
# needed to serve static files locally
ln -s local/lib/python3*/site-packages/oauth_dropins/static oauth_dropins_static
Now, you can fire up the gcloud emulator and run the tests:
gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode < /dev/null >& /dev/null &
python3 -m unittest discover -s tests -t .
kill %1
If you send a pull request, please include or update a test for your new code!
To run the app locally, use flask run:
gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode < /dev/null >& /dev/null &
GAE_ENV=localdev FLASK_ENV=development flask run -p 8080
Open localhost:8080 and you should see the Bridgy home page!
To test a poll or propagate task, find the relevant Would add task line in the logs, eg:
INFO:root:Would add task: projects//locations/us-central1/queues/poll {'app_engine_http_request': {'http_method': 'POST', 'relative_uri': '/_ah/queue/poll', 'app_engine_routing': {'service': 'background'}, 'body': b'source_key=agNhcHByFgsSB1R3aXR0ZXIiCXNjaG5hcmZlZAw&last_polled=1970-01-01-00-00-00', 'headers': {'Content-Type': 'application/x-www-form-urlencoded'}}, 'schedule_time': seconds: 1591176072
...pull out the relative_uri and body, and then put them together in a curl command against localhost:8080 (but don't run it yet!), eg:
curl -d 'source_key=agNhcHByFgsSB1R3aXR0ZXIiCXNjaG5hcmZlZAw&last_polled=1970-01-01-00-00-00' \
http://localhost:8080/_ah/queue/poll
Then, restart the app with FLASK_APP=background to run the background task processing service, eg:
gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode
GAE_ENV=localdev FLASK_ENV=development flask run -p 8080
Now, run the curl command you constructed above.
If you hit an error during setup, check out the oauth-dropins Troubleshooting/FAQ section. For searchability, here are a handful of error messages that have solutions there:
bash: ./bin/easy_install: ...bad interpreter: No such file or directory
ImportError: cannot import name certs
ImportError: cannot import name tweepy
File ".../site-packages/tweepy/auth.py", line 68, in _get_request_token
raise TweepError(e)
TweepError: must be _socket.socket, not socket
error: option --home not recognized
There's a good chance you'll need to make changes to granary or oauth-dropins at the same time as bridgy. To do that, clone their repos elsewhere, then install them in "source" mode with:
pip uninstall -y oauth-dropins
pip install -e <path-to-oauth-dropins-repo>
ln -sf <path-to-oauth-dropins-repo>/oauth_dropins/static oauth_dropins_static
pip uninstall -y granary
pip install -e <path to granary>
To deploy to App Engine, run scripts/deploy.sh.
remote_api_shell is a useful interactive Python shell that can interact with the production app's datastore, memcache, etc. To use it, create a service account and download its JSON credentials, put it somewhere safe, and put its path in your GOOGLE_APPLICATION_CREDENTIALS environment variable.
Deploying to your own App Engine project can be useful for testing, but is not recommended for production. To deploy to your own App Engine project, create a project on gcloud console and activate the Tasks API. Initialize the project on the command line using gcloud config set project <project-name> followed by gcloud app create. You will need to update TASKS_LOCATION in util.py to match your project's location. Finally, you will need to add your "background" domain (eg background.YOUR-APP-NAME.appspot.com) to OTHER_DOMAINS in util.py and set host_url in tasks.py to your base app url (eg app-dot-YOUR-APP-NAME.wn.r.appspot.com). Finally, deploy (after testing) with gcloud -q beta app deploy --no-cache --project YOUR-APP-NAME *.yaml
To work on the browser extension:
cd browser-extension
npm install
npm run test
To run just one test:
npm run test -- -t 'part of test name'
Browser extension: logs in the JavaScript console
If you're working on the browser extension, or you're sending in a bug report for it,, its JavaScript console logs are invaluable for debugging. Here's how to get them in Firefox:
- Open
about:debugging - Click This Firefox on the left
- Scroll down to Bridgy
- Click Inspect
- Click on the Console tab
Here's how to send them in with a bug report:
- Right click, Export Visible Messages To, File, save the file.
- Email the file to bridgy @ ryanb.org. Do not post or attach it to a GitHub issue, or anywhere else public, because it contains sensitive tokens and cookies.
Browser extension: release
Here's how to cut a new release of the browser extension and publish it to addons.mozilla.org:
ln -fs manifest.firefox.json manifest.json- Load the extension in Firefox (
about:debugging). Check that it works. - Bump the version in
browser-extension/manifest.json. - Update the Changelog in the README.md section below this one.
- Build and sign the artifact:
cd browser-extension/ npm test ./node_modules/web-ext/bin/web-ext.js build - Submit it to AMO.
It's usually auto-approved within minutes. Check the public listing here.# get API secret from Ryan if you don't have it ./node_modules/web-ext/bin/web-ext.js sign --api-key user:14645521:476 --api-secret ... # If this succeeds, it will say: ... Your add-on has been submitted for review. It passed validation but could not be automatically signed because this is a listed add-on. FAIL ...
Here's how to publish it to the Chrome Web Store:
ln -fs manifest.chrome.json manifest.json- Load the extension in Chrome (
chrome://extensions/, Developer mode on). Check that it works. - Build and sign the artifact:
cd browser-extension/ npm test ./node_modules/web-ext/bin/web-ext.js build - Open the console.
- Open the Bridgy item.
- Choose Package on the left.
- Click the Upload new package button.
- Upload the new version's zip file from
browser-extension/web-ext-artifacts/. - Update the Changelog in the Description box. Leave the rest unchanged.
- Click Save draft, then Submit for review.
Browser extension: Changelog
0.7.0, 2024-01-03
- Remove Instgram. Their anti-bot defenses have led them to suspend a couple people's accounts for using this extension, so we're disabling it out of an abundance of caution. Sorry for the bad news.
0.6.1, 2022-09-18
- Don't open silo login pages if they're not logged in. This ran at extension startup time, which was mostly harmless in manifest v2 since the background page was persistent stayed loaded, but in manifest v3 it's a service worker or non-persistent background page, which gets unloaded and then reloaded every 5m.
0.6.0, 2022-09-17
- Migrate Chrome (but not Firefox) from Manifest v2 to v3.
0.5, 2022-07-2
Related Skills
bluebubbles
339.5kUse when you need to send or manage iMessages via BlueBubbles (recommended iMessage integration). Calls go through the generic message tool with channel="bluebubbles".
bear-notes
339.5kCreate, search, and manage Bear notes via grizzly CLI.
claude-ads
1.4kComprehensive paid advertising audit & optimization skill for Claude Code. 186 checks across Google, Meta, YouTube, LinkedIn, TikTok & Microsoft Ads with weighted scoring, parallel agents, and industry templates.
claude-ads
1.4kComprehensive paid advertising audit & optimization skill for Claude Code. 186 checks across Google, Meta, YouTube, LinkedIn, TikTok & Microsoft Ads with weighted scoring, parallel agents, and industry templates.
