Update documentation: add a small intro and document webfinger.
doc/guile-fediverse.texi
| 30 | 30 | implementation of some algorithms and specifications used in the Fediverse. | |
| 31 | 31 | ||
| 32 | 32 | @menu | |
| 33 | - | * Introduction:: | |
| 34 | - | * API Reference:: | |
| 33 | + | * Introduction:: What is the Fediverse? | |
| 34 | + | * API Reference:: Description of the library interface. | |
| 35 | + | ||
| 36 | + | @detailmenu | |
| 37 | + | --- The Detailed Node Listing --- | |
| 38 | + | ||
| 39 | + | API Reference | |
| 40 | + | ||
| 41 | + | * ActivityStreams API:: Encoding and Decoding Activities. | |
| 42 | + | * Webfinger API:: Finding resource locations. | |
| 43 | + | ||
| 44 | + | @end detailmenu | |
| 35 | 45 | @end menu | |
| 36 | 46 | ||
| 37 | 47 | @node Introduction | |
| 38 | 48 | @chapter Introduction | |
| 39 | 49 | ||
| 40 | - | TODO | |
| 50 | + | The Fediverse is a collection of applications and servers that provide a social | |
| 51 | + | media platform and similar services. They individually work as a platform, | |
| 52 | + | with users (identities) and services and collectivelly form a bigger social | |
| 53 | + | network, the Fedivere, by the use of different federating protocols. Some | |
| 54 | + | of them are implemented in this library. | |
| 55 | + | ||
| 56 | + | If you are new to the concept of the Fediverse, you should try out one of the | |
| 57 | + | great servers that provide service for Mastodon (the most well-known server), | |
| 58 | + | Pleroma (a micro-blogging platform), Peertube (a video sharing platform), and | |
| 59 | + | many more! With one account on one of these platforms, you can interact with | |
| 60 | + | any account on any of these other platforms. Imagine commenting a Peertube | |
| 61 | + | video from Mastodon and sharing it with a friend on Pleroma :) | |
| 41 | 62 | ||
| 42 | 63 | @node API Reference | |
| 43 | 64 | @chapter API Reference | |
| 44 | 65 | ||
| 66 | + | @node ActivityStreams API | |
| 67 | + | @section ActivityStreams API | |
| 68 | + | ||
| 45 | 69 | TODO | |
| 46 | 70 | ||
| 71 | + | @node Webfinger API | |
| 72 | + | @section Webfinger API | |
| 73 | + | ||
| 74 | + | Webfinger is a protocol that allows you to query resource location at a | |
| 75 | + | well-known end-point. The protocol is described in detail in | |
| 76 | + | @uref{RFC 7033, https://tools.ietf.org/html/rfc7033}. | |
| 77 | + | ||
| 78 | + | This library provides a small interface to use this protocol in the | |
| 79 | + | @code{(webfinger webfinger)} module. | |
| 80 | + | ||
| 81 | + | First of all, webfinger answers are in the form of a @dfn{JRD} record, meaning | |
| 82 | + | JSON Resource Descriptor. This record is encoded in the @code{<jrd-record>} | |
| 83 | + | data type: | |
| 84 | + | ||
| 85 | + | @deffn {Datatype} <jrd-record> | |
| 86 | + | ||
| 87 | + | @table @asis | |
| 88 | + | @item @code{subject} | |
| 89 | + | The resource that was requested and for which the answer is given. This is | |
| 90 | + | a URI, as a string. | |
| 91 | + | ||
| 92 | + | @item @code{aliases} | |
| 93 | + | A list of zero or more URI as strings, that identify the same entity. | |
| 94 | + | ||
| 95 | + | @item @code{properties} | |
| 96 | + | A list of key-value pairs (an alist) whose keys and values are strings. This | |
| 97 | + | represents a set of properties on the subject that the webfinger server wants | |
| 98 | + | to give you. | |
| 99 | + | ||
| 100 | + | @item @code{links} | |
| 101 | + | A list of links that correspond to the location of the requested identity. These | |
| 102 | + | links are objects of type @code{<link-record>}. | |
| 103 | + | ||
| 104 | + | @end table | |
| 105 | + | @end deffn | |
| 106 | + | ||
| 107 | + | @deffn {Datatype} <link-record> | |
| 108 | + | ||
| 109 | + | @table @asis | |
| 110 | + | @item @code{rel} | |
| 111 | + | A string that is either a URI or a registered relation type, as defined at | |
| 112 | + | @url{http://www.iana.org/assignments/link-relations/}. | |
| 113 | + | ||
| 114 | + | @item @code{type} | |
| 115 | + | A string that represents the MIME/Type of the content accessible through the | |
| 116 | + | link. | |
| 117 | + | ||
| 118 | + | @item @code{href} | |
| 119 | + | A string that represents the URI at which you can find of the requested | |
| 120 | + | resource. | |
| 121 | + | ||
| 122 | + | @item @code{titles} | |
| 123 | + | An association list where keys are strings that represent a language name and | |
| 124 | + | value represents the title for the content of the link in that language. | |
| 125 | + | ||
| 126 | + | @item @code{properties} | |
| 127 | + | A list of key-value pairs (an alist) whose keys and values are strings. This | |
| 128 | + | represents a set of properties on the link that the webfinger server wants | |
| 129 | + | to give you. | |
| 130 | + | ||
| 131 | + | @end table | |
| 132 | + | @end deffn | |
| 133 | + | ||
| 134 | + | The library provides two procedures to retrieve data from a webfinger server. | |
| 135 | + | A low-level procedure that can query anything and a higher-level procedure to | |
| 136 | + | specifically query actor objects to a Fediverse server. | |
| 137 | + | ||
| 138 | + | @deffn {Scheme Procedure} webfinger-query @var{server} @var{resource} @ | |
| 139 | + | [@var{rel}] | |
| 140 | + | Queries a webfinger @var{server} for @var{resource}, which must be a URI, | |
| 141 | + | represented as a string. Returns a @code{jrd-record} object. | |
| 142 | + | ||
| 143 | + | @end deffn | |
| 144 | + | ||
| 145 | + | @deffn {Scheme Procedure} find-actor-object @var{user} @var{server} | |
| 146 | + | Queries a webfinger @var{server} for the actor object of @@@var{user}@@@var{server}. | |
| 147 | + | Note that @var{server} should be a string that represents the server name, but | |
| 148 | + | has no scheme. The procedure returns a string that corresponds to the best | |
| 149 | + | link returned by the webfinger server (determined by the type when available). | |
| 150 | + | ||
| 151 | + | This queries the resource ``acct:@var{user}@@@var{server}'' to the server. | |
| 152 | + | @end deffn | |
| 153 | + | ||
| 47 | 154 | @bye |