aboutsummaryrefslogtreecommitdiff
path: root/examples/auto_follower_webhook.py
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-05-30 19:43:55 +0200
committergrunfink <grunfink@comam.es>2025-05-30 19:43:55 +0200
commit706816b4321337d56ff3121186567363b882d01d (patch)
treefd2791488024273af9795fe6399f507a78994439 /examples/auto_follower_webhook.py
parentf055c8b694a398868d14fd70df61d02429846dae (diff)
Added uid, basedir and baseurl to the notify webhook message.
Diffstat (limited to 'examples/auto_follower_webhook.py')
-rwxr-xr-xexamples/auto_follower_webhook.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/auto_follower_webhook.py b/examples/auto_follower_webhook.py
index e1192c1..eb632a3 100755
--- a/examples/auto_follower_webhook.py
+++ b/examples/auto_follower_webhook.py
@@ -2,8 +2,7 @@
# This is an example of a snac webhook that automatically follows all new followers.
-# To use it, set the variables snac_basedir and snac_user to something reasonable,
-# configure the user webhook to be http://localhost:12345, and run this program.
+# To use it, configure the user webhook to be http://localhost:12345, and run this program.
# copyright (C) 2025 grunfink et al. / MIT license
@@ -14,8 +13,6 @@ import os
host_name = "localhost"
server_port = 12345
-snac_basedir = "/var/snac/example_instance"
-snac_user = "example_user"
class SnacAutoResponderServer(BaseHTTPRequestHandler):
@@ -35,7 +32,10 @@ class SnacAutoResponderServer(BaseHTTPRequestHandler):
if type == "Follow":
actor = noti["actor"]
- cmd = "snac follow %s %s %s" % (snac_basedir, snac_user, actor)
+ uid = noti["uid"]
+ basedir = noti["basedir"]
+
+ cmd = "snac follow %s %s %s" % (basedir, uid, actor)
os.system(cmd)