From 6cf0e264b121b754bf8006914c23d3e45f9d0415 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Fri, 24 May 2019 02:00:30 -0400 Subject: style changes for index.html template --- assets/tmpl/index.html | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'assets/tmpl/index.html') diff --git a/assets/tmpl/index.html b/assets/tmpl/index.html index 56fdf96..9827646 100644 --- a/assets/tmpl/index.html +++ b/assets/tmpl/index.html @@ -22,39 +22,41 @@ {{.Mail}}
-

{{.Desc}}

+
+

{{.Desc}}

+

API base URL:

-
/api
-

Formats available:

+
/api
+

Formats available:

/api/plain

Endpoints:

-
/api/plain/users
+        
/api/plain/users
 /api/plain/mentions
 /api/plain/tweets
 /api/plain/tags
-

Query by user:

+

Query by user:

$ curl '{{.URL}}/api/plain/users?q=foo'
 foo               https://example.com/twtxt.txt     2019-05-09T08:42:23.000Z
 foobar            https://example2.com/twtxt.txt    2019-03-14T19:23:00.000Z
 foo_barrington    https://example3.com/twtxt.txt    2019-05-01T15:59:39.000Z
-

Query by tweet content:

+

Query by tweet content:

$ curl '{{.URL}}/api/plain/tweets?q=getwtxt'
 foo_barrington    https://example3.com/twtxt.txt    2019-04-30T06:00:09.000Z    I just built getwtxt, time to set it up!
-

Query by mention:

+

Query by mention:

$ curl '{{.URL}}/api/plain/mentions?url=https://foobarrington.co.uk/twtxt.txt'
 foo    https://example.com/twtxt.txt    2019-02-26T11:06:44.000Z    @<foo_barrington https://example3.com/twtxt.txt> Hey!! Are you still working on that project?
-

Query by tag:

+

Query by tag:

$ curl '{{.URL}}/api/plain/tags/programming'
 foo    https://example.com/twtxt.txt    2019-03-01T09:31:02.000Z    I love #programming!
-

Get latest 20 tweets:

+

Get latest 20 tweets:

$ curl '{{.URL}}/api/plain/tweets'
 foobar    https://example2.com/twtxt.txt    2019-05-13T12:46:20.000Z    It's been a busy day at work!
 ...
-

Get all users:

+

Get all users:

$ curl '{{.URL}}/api/plain/users'
 foo_barrington    https://example3.com/twtxt.txt    2018-11-21T18:31:00.000Z
 ...
-

Add new user by submitting a POST request. If both variables are not used, or the user already exists in this registry, the server will respond with 400 Bad Request

+

Add new user by submitting a POST request. If both variables are not used, or the user already exists in this registry, the server will respond with 400 Bad Request

$ curl -X POST '{{.URL}}/api/plain/users?url=https://example3.com/twtxt.txt&nickname=foo_barrington'
 200 OK
-- cgit 1.4.1-2-gfad0