From 3df037d0a9d763256508092f3b0c7362b22431e2 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Tue, 4 Jun 2019 01:42:17 -0400 Subject: refactored landing page template and tweaked styling --- assets/style.css | 7 +++++++ assets/tmpl/index.html | 57 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/assets/style.css b/assets/style.css index 0e57190..86f018d 100644 --- a/assets/style.css +++ b/assets/style.css @@ -24,6 +24,7 @@ #body { font-size: 1.0em; + margin-top: -1.5rem; } #info { @@ -44,3 +45,9 @@ text-align: center; font-size: 0.9em; } + +p { + text-indent: 1.5em; + padding-top: 1.0rem; + margin-bottom: -0.3rem; +} diff --git a/assets/tmpl/index.html b/assets/tmpl/index.html index 509107b..dea649c 100644 --- a/assets/tmpl/index.html +++ b/assets/tmpl/index.html @@ -34,33 +34,50 @@ /api/plain/mentions /api/plain/tweets /api/plain/tags -

All queries accept ?page=N as a parameter, returning groups of 20 results. - This may be omitted for the first page of results.

-

Query by user:

-
$ curl '{{.URL}}/api/plain/users?q=foo'
+        

Add new user by submitting a POST request to the /api/plain/users endpoint. + If both ?url=X and ?nickname=X are not passed, or the user already exists in + this registry, you will receive 400 Bad Request as a response. If you are unsure what went + wrong, the error message should provide enough information for you to correct the request.

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

Query responses are in descending chronological order. This means the newest user or tweet will be in the + first row of the response, with older users or tweets in subsequent rows. Additionally, All queries accept ?page=N + as a parameter, returning groups of 20 results. This may be omitted for the first page of results.

+

Get all users:

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

Query for user by URL:

+
$ curl '{{.URL}}/api/plain/users?url=https://example3.com/twtxt.txt'
 foo_barrington    https://example3.com/twtxt.txt    2019-05-01T15:59:39.000Z
-

Query by tweet content:

-
$ curl '{{.URL}}/api/plain/tweets?q=getwtxt&page=2'
+      

Query for user by keyword:

+
$ curl '{{.URL}}/api/plain/users?q=bar'
+foobar            https://example2.com/twtxt.txt    2019-05-14T19:23:00.000Z
+foo_barrington    https://example3.com/twtxt.txt    2019-04-01T15:59:39.000Z
+

Get all 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!
+...
+

Query tweets by keyword:

+
$ 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:

+

Get all tweets with mentions:

+
$ curl '{{.URL}}/api/plain/mentions'
+foo               https://example.com/twtxt.txt     2019-02-28T11:06:44.000Z    @<foo_barrington https://example3.com/twtxt.txt> Hey!! Are you still working on that project?
+bar               https://mxmmplm.com/twtxt.txt     2019-02-27T11:06:44.000Z    @<foobar https://example2.com/twtxt.txt> How's your day going, bud?
+foo_barrington    https://example3.com/twtxt.txt    2019-02-26T11:06:44.000Z    @<foo https://example.com/twtxt.txt> Did you eat my lunch?
+

Query tweets by mention URL:

$ 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:

+

Get all tweets with tags:

+
$ curl '{{.URL}}/api/plain/tags'
+foo    https://example.com/twtxt.txt    2019-03-01T09:33:12.000Z    No, seriously, I need help.
+foo    https://example.com/twtxt.txt    2019-03-01T09:32:05.000Z    Seriously, I love #programming!
+foo    https://example.com/twtxt.txt    2019-03-01T09:31:02.000Z    I love #programming!
+

Query tweets by tag:

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

Get 20 tweets:

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

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

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