From a8837a72909d586e21cda0a40e4a4047235f9939 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 21 Aug 2018 09:17:07 -0400 Subject: [PATCH] Initial commit --- activitypub.php | 11 +++++++++++ inc/actors.php | 23 +++++++++++++++++++++++ inc/api.php | 16 ++++++++++++++++ inc/inbox.php | 3 +++ inc/outbox.php | 3 +++ 5 files changed, 56 insertions(+) create mode 100644 activitypub.php create mode 100644 inc/actors.php create mode 100644 inc/api.php create mode 100644 inc/inbox.php create mode 100644 inc/outbox.php diff --git a/activitypub.php b/activitypub.php new file mode 100644 index 0000000..6c0f888 --- /dev/null +++ b/activitypub.php @@ -0,0 +1,11 @@ +post_author; +} +add_action( 'publish_post', 'post_published_activity', 10, 2 ); +?> diff --git a/inc/actors.php b/inc/actors.php new file mode 100644 index 0000000..fd74a11 --- /dev/null +++ b/inc/actors.php @@ -0,0 +1,23 @@ + array( "https://www.w3.org/ns/activitystreams" ), + "type" => "Person", + "id" => get_rest_url( null, sprintf( '/activitypub/v1/user/%s', $handle ) ), + "following" => "TODO", // link to following JSON + "followers" => "TODO", // link to followers JSON + "liked" => "TODO", // link to liked JSON + "inbox" => "TODO", // link to inbox JSON + "outbox" => "TODO", // link to outbox JSON + "preferredUsername": $handle, + "name": get_the_author_meta( 'display_name', $authorID ), + "summary": get_the_author_meta( 'description', $authorID ), + "icon": get_avatar_url ( $authorID ), + "url": get_the_author_meta( 'user_url', $authorID ), + ); + return $actor; +} +?> diff --git a/inc/api.php b/inc/api.php new file mode 100644 index 0000000..229df9e --- /dev/null +++ b/inc/api.php @@ -0,0 +1,16 @@ +[A-Za-z0-9]+)', array( + 'methods' => 'GET', + 'callback' => 'get_user', + ) ); +} ); +?> diff --git a/inc/inbox.php b/inc/inbox.php new file mode 100644 index 0000000..62a2de0 --- /dev/null +++ b/inc/inbox.php @@ -0,0 +1,3 @@ + diff --git a/inc/outbox.php b/inc/outbox.php new file mode 100644 index 0000000..62a2de0 --- /dev/null +++ b/inc/outbox.php @@ -0,0 +1,3 @@ +