diff --git a/index.php b/index.php index 55ac564..03cb861 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,6 @@ // This is where you set up your account's name and bio. You also need to provide a public/private keypair. The posting page is protected with a password that also needs to be set here. // Set up the Actor's information - $siteTitle = "ActivityPub-Single-PHP-File"; $username = rawurlencode("example"); // Encoded as it is often used as part of a URl $realName = "E. Xample. Jr."; $summary = "Some text about the user."; @@ -78,18 +77,18 @@ !empty( $_GET["path"] ) ? $path = $_GET["path"] : home(); switch ($path) { case ".well-known/webfinger": - webfinger(); + webfinger(); // Mandatory. Static. case rawurldecode( $username ): - username(); + username(); // Mandatory. Static case "following": - following(); + following(); // Mandatory. Static case "followers": - followers(); + followers(); // Mandatory. Could be dynamic case "inbox": - inbox(); + inbox(); // Mandatory. Only accepts follow requests. case "write": - write(); - case "send": + write(); // User interface for writing posts + case "send": // API for posting content to the Fediverse send(); default: die(); @@ -335,39 +334,30 @@ // User Interface for Homepage: // This creates a basic HTML page. This content appears when someone visits the root of your site. function home() { - global $username, $server, $realName, $siteTitle, $summary; - echo <<< HTML - - - - - {$siteTitle} - - - -

{$siteTitle}

- - icon -

{$realName}

-

@{$username}@{$server}

-

{$summary}

-
- - - - HTML; - die(); + global $username, $server, $realName, $summary; +echo <<< HTML + + + + + {$realName} + + + + + icon +

{$realName}

+

@{$username}@{$server}

+

{$summary}

+
+

This software is licenced under AGPL 3.0.

+

This site is a basic ActivityPub server designed to be a lightweight educational tool.

+ + +HTML; +die(); } // User Interface for Writing: