wordpress-activitypub
wordpress-activitypub copied to clipboard
Follow button
Hi! I'd love to put a follow button on my blog, rather than tell people "go follow @[email protected]". But currently, if I click on the mastodon profile, I'm taken to my author page and as far as I understand, there's no way to sign up from anywhere on that page. Is there a link somewhere that can be used and that I've missed? And if so, would you consider adding an option for an automated follow button on author pages?
Duplicate of #14
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Keep
There's a test of this in action with a completely standalone php script here:
https://chriskthomas.com/users/chris/remote_follow
It's just a proof of concept. I'll update this with the source code once it's released.
I just followed you… It appears to work from this side of things… haven’t seen a post from you yet, but you’ll be receiving a comment or a like of some sort when I do.
From: Matthew W. Thomas @.> Sent: Sunday, September 4, 2022 5:27 PM To: pfefferle/wordpress-activitypub @.> Cc: Subscribed @.***> Subject: Re: [pfefferle/wordpress-activitypub] Follow button (Issue #145)
There's a test of this in action with a completely standalone php script here:
https://chriskthomas.com/fedi-follow/
It's just a proof of concept. I'll update this with the source code once it's released.
— Reply to this email directly, view it on GitHubhttps://github.com/pfefferle/wordpress-activitypub/issues/145#issuecomment-1236418444, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADS4MACM2OG6PTLOILY3UD3V4UH4DANCNFSM5UZT7XWQ. You are receiving this because you are subscribed to this thread.Message ID: @.@.>>
I've put up a public general use version that allows your username and instance to be set via query parameters. You can use this service in two ways:
- (Simplest) You can share the direct url to your follow page on your WordPress site. The syntax is:
https://apfollow.mwt.me/?user=username&instance=instance.tld
for a user with the handle@[email protected]
. Here is an example of a follow page. - (Harder) You can reverse proxy the service to use it on your own domain. For example, the following rule works in my
.htaccess
file on LiteSpeed web server:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^users/(.*)/remote_follow$ "https://apfollow.mwt.me/?user=$1&instance=yourdomain.com" [P,E=Proxy-Host:apfollow.mwt.me,L]
</IfModule>
on Apache, it should work with a simpler:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^users/(.*)/remote_follow$ "https://apfollow.mwt.me/?user=$1&instance=yourdomain.com" [P,L]
</IfModule>
This will make the follow page accessible for all users at /users/{username}/remote_follow
, which is the same url scheme used by Mastodon.
This should work as a general following service for all ActivityPub sites.
Source code is up on mwt/apfollow. It's licensed AGPL because I took a bunch of frontend from Mastodon.
Edit: There are now some example follow buttons in the readme of the project. Some screenshots (2x scale):
You can paste the html from those sample buttons into the widget block editor to get something similar to #14. You can see an example of this on the left sidebar here: https://chriskthomas.com/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Keep!
We added a follow block in the newest version!