• Stars
    star
    244
  • Rank 164,876 (Top 4 %)
  • Language
    Python
  • License
    Creative Commons ...
  • Created about 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🕸 Bridges the IndieWeb to Mastodon and the fediverse via ActivityPub.

Bridgy Fed Circle CI Coverage Status

Bridgy Fed connects your web site to Mastodon and the fediverse via ActivityPub, webmentions, and microformats2. Your site gets its own fediverse profile, posts and avatar and header and all. Bridgy Fed translates likes, reposts, mentions, follows, and more back and forth. See the user docs and developer docs for more details.

https://fed.brid.gy/

Also see the original design blog posts.

License: This project is placed in the public domain.

Development

Development reference docs are at bridgy-fed.readthedocs.io. 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 beta cloud-datastore-emulator to install the datastore emulator. Once you have them, set up your environment by running these commands in the repo root directory:

gcloud config set project bridgy-federated
python3 -m venv local
source local/bin/activate
pip install -r requirements.txt

Now, run the tests to check that everything is set up ok:

gcloud beta emulators datastore start --use-firestore-in-datastore-mode --no-store-on-disk --host-port=localhost:8089 --quiet < /dev/null >& /dev/null &
python3 -m unittest discover

Finally, run this in the repo root directory to start the web app locally:

GAE_ENV=localdev FLASK_ENV=development flask run -p 8080

If you send a pull request, please include (or update) a test for the new functionality!

If you hit an error during setup, check out the oauth-dropins Troubleshooting/FAQ section.

You may need to change granary, oauth-dropins, mf2util, or other dependencies as well as as Bridgy Fed. To do that, clone their repo locally, then install them in "source" mode with e.g.:

pip uninstall -y granary
pip install -e <path to granary>

To deploy to the production instance on App Engine - if @snarfed has added you as an owner - run:

gcloud -q beta app deploy --no-cache --project bridgy-federated *.yaml

How to add a new protocol

  1. Determine how you'll map the new protocol to other existing Bridgy Fed protocols, specifically identity, protocol inference, events, and operations. Add those to the existing tables in the docs in a PR. This is an important step before you start writing code.
  2. If the new protocol uses a new data format - which is likely - add that format to granary in a new file with functions that convert to/from ActivityStreams 1 and tests. See nostr.py and test_nostr.py for examples.
  3. Implement the protocol in a new .py file as a subclass of both Protocol and User. Implement the send, fetch, serve, and target_for methods from Protocol and readable_id, web_url, ap_address, and ap_actor from User .
  4. TODO: add a new usage section to the docs for the new protocol.
  5. TODO: does the new protocol need any new UI or signup functionality? Unusual, but not impossible. Add that if necessary.
  6. Add the new protocol's logo to static/, use it in templates/user.html.

Stats

I occasionally generate stats and graphs of usage and growth via BigQuery, like I do with Bridgy. Here's how.

  1. Export the full datastore to Google Cloud Storage. Include all entities except MagicKey. Check to see if any new kinds have been added since the last time this command was run.

    gcloud datastore export --async gs://bridgy-federated.appspot.com/stats/ --kinds Follower,Object
    

    Note that --kinds is required. From the export docs:

    Data exported without specifying an entity filter cannot be loaded into BigQuery.

  2. Wait for it to be done with gcloud datastore operations list | grep done.

  3. Import it into BigQuery:

    for kind in Follower Object; do
      bq load --replace --nosync --source_format=DATASTORE_BACKUP datastore.$kind gs://bridgy-federated.appspot.com/stats/all_namespaces/kind_$kind/all_namespaces_kind_$kind.export_metadata
    done
    
  4. Check the jobs with bq ls -j, then wait for them with bq wait.

  5. Run the full stats BigQuery query. Download the results as CSV.

  6. Open the stats spreadsheet. Import the CSV, replacing the data sheet.

  7. Check out the graphs! Save full size images with OS or browser screenshots, thumbnails with the Download Chart button.

More Repositories

1

bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
Python
657
star
2

granary

💬 The social web translator
Python
387
star
3

huffduff-video

📺 Extract the audio from videos on YouTube, Vimeo, and other sites and send it to Huffduffer.
Python
91
star
4

mockfacebook

UNMAINTAINED: A standalone HTTP server that implements Facebook's FQL and Graph API.
Python
61
star
5

ownyourresponses

Creates posts on your web site for your likes, replies, reshares, and event RSVPs on social networks.
Python
44
star
6

open-in-app

UNMAINTAINED: Android app that makes Facebook, Twitter, etc. links open in their native apps instead of the browser.
Java
43
star
7

twitter-atom

Brings your Twitter feed to your feed reader!
HTML
40
star
8

arroba

Python implementation of Bluesky PDS and AT Protocol, including repo, MST, and sync XRPC methods
Python
35
star
9

oauth-dropins

🔑 Drop-in OAuth client flows for Python on Google App Engine.
Python
33
star
10

facebook-atom

Brings your Facebook news feed to your feed reader!
Python
32
star
11

p4sync

A library and plugins for a few music players that (attempts to) synchronize playback across multiple computers. Details: http://snarfed.org/synchronizing_mp3_playback
C
32
star
12

indie-map

🗺 A public IndieWeb social graph and dataset.
Python
32
star
13

lexrpc

Python client and server for Bluesky/AT Protocol's XRPC + Lexicon
Python
31
star
14

instagram-atom

Brings your Instagram feed to your feed reader!
JavaScript
28
star
15

libmsntp

libmsntp is a full-featured, compact, portable SNTP library. (SNTP is a simplified version of NTP.)
C
21
star
16

webfinger-unofficial

A WebFinger server for Facebook and Twitter.
Python
19
star
17

misc

Miscellaneous stuff: scripts, patches, userstyles, etc.
Python
19
star
18

freedom

UNMAINTAINED: Copies your Facebook, Twitter, and Google+ posts to a blog, with all formatting and details intact.
Python
17
star
19

portablecontacts-unofficial

UNMAINTAINED: A library and REST API that serves Facebook and Twitter user data in PortableContacts format
Python
14
star
20

webutil

Common utilities and handler code for Python webapps and App Engine.
Python
13
star
21

ostatus-unofficial

UNMAINTAINED: A stand-in, proxy OStatus server for sites like Facebook and Twitter that don't implement it themselves.
Python
11
star
22

salmon-unofficial

A web service that implements the Salmon distributed comment protocol for Facebook, Twitter, and Google+.
Python
10
star
23

carbox

Content Addressable aRchive file tools for python
Python
7
star
24

ownyourcheckin

copies your Facebook checkins to your WordPress blog
Python
7
star
25

baffle

UNMAINTAINED: Lets you use Microsub client apps with traditional feed readers like NewsBlur.
JavaScript
5
star
26

hackermention

Universal webmention backfeed for silos like Reddit, Hacker News, and more.
Python
4
star
27

flask-gae-static

Flask extension that serves static file handlers in Google App Engine app.yaml files
Python
4
star
28

plusstreamfeed

Converts your Google+ stream (ie posts from people in your circles) to Atom so you can read it in a feed reader
Python
3
star
29

fillcode

An Emacs minor mode that fills, or wraps, some parts of source code.
Emacs Lisp
3
star
30

advent-of-code-2021

Advent of Code 2021 solutions in esoteric languages
Emacs Lisp
3
star
31

bluesky-atom

Read your Bluesky skyline in your feed reader!
Python
2
star
32

snarfed.org

My web site
HTML
2
star
33

bowflex-planner

UNMAINTAINED: A webapp that optimizes Bowflex exercise routines to minimize rearranging weights and attachments.
Go
1
star
34

beautifulsoup

Mirror of the official BeautifulSoup repo.
Python
1
star
35

codeherenow

A scrolling ticker of source code checkins made by people recently at a specific place. Good for hackathons, conferences, etc. Also includes current local Twitter posts, Flickr photos, etc.
Python
1
star
36

dag-json

Python implemention of the IPLD DAG-JSON codec
Python
1
star
37

shell-py3

🖥 Interactive server-side Python shell for Google App Engine Python 3.7 Standard.
Python
1
star