From 920306cbcad3df05e01699cd19f3767e069ab139 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Mon, 13 May 2019 17:42:32 -0400 Subject: template initialization added --- assets/style.css | 32 ++++++++++++++++++++++++++++++ assets/tmpl/index.html | 53 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 1 deletion(-) (limited to 'assets') diff --git a/assets/style.css b/assets/style.css index e148bda..5f62e1c 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1 +1,33 @@ @import url("https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/dark.min.css"); + +#container { + max-width: 800px; + margin: auto; +} + +#head { + padding-top: 20px; + padding-bottom: 20px; + text-align: center; + font-size: 2em; +} + +#subhead { + text-align: right; + font-size: 1.2em; +} + +#body { + font-size: 1.0em; +} + +#info { + font-size: 0.9em; + padding-top: 10px; +} + +#foot { + padding-top: 20px; + text-align: center; + font-size: 0.8em; +} diff --git a/assets/tmpl/index.html b/assets/tmpl/index.html index fdd91ca..e702d08 100644 --- a/assets/tmpl/index.html +++ b/assets/tmpl/index.html @@ -3,11 +3,62 @@ + - {{.Title}} - twtxt Registry + {{.Name}} - twtxt Registry
+ +
+ twtxt registry +
+
+

{{.Desc}}

+

API base URL:

+
/api
+

Formats available:

+
/api/plain
+

Endpoints:

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

Query by user:

+
$ curl 'https://getwtxt.example.com/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:

+
$ curl 'https://getwtxt.example.com/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:

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

Query by tag:

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

Get latest 20 tweets:

+
$ curl 'https://getwtxt.example.com/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:

+
$ curl 'https://getwtxt.example.com/api/plain/users'
+foo_barrington    https://example3.com/twtxt.txt    2018-11-21T18:31:00.000Z
+...
+

Add new user:

+
$ curl -X POST 'https://getwtxt.example.com/api/plain/users?url=https://example3.com/twtxt.txt&nickname=foo_barrington'
+OK
+
+
+ Instance Owner: {{.Owner}}
+ Mail: {{.Mail}}
+
+
-- cgit 1.4.1-2-gfad0