From a40654132655fc3f5e57f31cb8eda36a28ec6d1d Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sun, 8 Jan 2023 14:49:44 -0500 Subject: readme --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index a1ba728..6fe1670 100644 --- a/README.md +++ b/README.md @@ -10,25 +10,25 @@ With communique it's easy to expose an RSS/atom feed as an ActivityPub actor, wh Given a configuration file like this: - domain = "https://example.com" + domain = "https://example.com" - [[handlers]] - name = "sample" - exec = "sample-cgi-handler.sh" - interval = "5s" - dedupWindow = "30s" + [[handlers]] + name = "sample" + exec = "sample-cgi-handler.sh" + interval = "5s" + dedupWindow = "30s" And a `sample-cgi-handler.sh` like: - #!/bin/bash - echo "Content-type: application/atom+xml" - echo "" - echo ' - - example content - - ' - exit 0 + #!/bin/bash + echo "Content-type: application/atom+xml" + echo "" + echo ' + + example content + + ' + exit 0 Communique will execute `sample-cgi-handler.sh` every 5 seconds, deduplicating the extracted ` for a period of 30 seconds. Any unique items that are found are persisted to our actors inbox and delivered to all actors that follow our actor. @@ -38,23 +38,23 @@ Run the following steps to see the example above in action. 1. Clone the repository - git clone https://git.capotej.com/capotej/communique + git clone https://git.capotej.com/capotej/communique 2. Go to the directory - cd communique + cd communique 3. Compile and run it (feel free to click Deny on any firewall warnings) - go run main.go + go run main.go 4. In another terminal, you can now see the actor page - curl -H 'Accept: application/json' http://localhost:8080/actors/sample | python3 -m json.tool + curl -H 'Accept: application/json' http://localhost:8080/actors/sample | python3 -m json.tool 5. And their outbox - curl -H 'Accept: application/json' http://localhost:8080/actors/sample/outbox | python3 -m json.tool + curl -H 'Accept: application/json' http://localhost:8080/actors/sample/outbox | python3 -m json.tool If this were running on a real domain, like "https://example.com", we would now be able to follow this actor at `@sample@example.com` from any ActivityPub service and see its posts on our timeline. -- cgit v1.2.3