A small registry server for twtxt, which allows to query for mentions and hash tags.
This repository has been archived on 2019-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
DracoBlue e1b256483b Added User-Agent to request 2016-02-12 23:56:17 +01:00
src Added User-Agent to request 2016-02-12 23:56:17 +01:00
.gitignore Added initial version 2016-02-11 15:52:15 +01:00
README.md Added memcached and check for 304 Not Modified. 2016-02-12 23:50:57 +01:00
package.json Added User-Agent to request 2016-02-12 23:56:17 +01:00

README.md

Twtxt Registry Server

A small registry server for twtxt, which allows to query for mentions and hash tags.

Prerequisites

Installation

$ npm install
$ export PORT=8080
$ export ELASTICSEARCH_HOST=localhost
$ export ELASTICSEARCH_PORT=9200
$ export MEMCACHED_HOST=localhost
$ export MEMCACHED_PORT=9200
$ node src/server.js

Example API calls for the Plain-Text-Api

Add a new Twtxt User to the Registry:

$ curl -X POST http://localhost:8080/api/plain/users?url=https://dracoblue.net/twtxt.txt&nickname=dracoblue
OK

See latest tweets in the Registry (e.g. https://registry.twtxt.org/api/plain/tweets):

$ curl http://localhost:8080/api/plain/tweets
@<dracoblue https://dracoblue.net/twtxt.txt>	2016-02-06T21:32:02.000Z	@erlehmann is messing with timestamps in @buckket #twtxt :)
@<dracoblue https://dracoblue.net/twtxt.txt>	2016-02-06T12:14:18.000Z	Simple nodejs script to convert your twitter timeline to twtxt: https://t.co/txnWsC5jvA ( find my #twtxt at https://t.co/uN1KDXwJ8B )

Search for tweets in the Registry (e.g. https://registry.twtxt.org/api/plain/tweets?q=twtxt):

$ curl http://localhost:8080/api/plain/tweets?q=twtxt
@<buckket https://buckket.org/twtxt.txt>	2016-02-09T12:42:26.000Z	Do we need an IRC channel for twtxt?
@<buckket https://buckket.org/twtxt.txt>	2016-02-09T12:42:12.000Z	Good Morning, twtxt-world!

Retrieve a list of all mentions of a specific twtxt User like https://buckket.org/twtxt.txt (e.g. https://registry.twtxt.org/api/plain/mentions?url=https://buckket.org/twtxt.txt):

$ curl http://localhost:8080/api/plain/mentions?url=https://buckket.org/twtxt.txt
@<dracoblue https://dracoblue.net/twtxt.txt>	2016-02-09T12:57:59.000Z	@<buckket https://buckket.org/twtxt.txt> something like https://gitter.im/ or a freenode channel?
@<dracoblue https://dracoblue.net/twtxt.txt>	2016-02-08T22:51:47.000Z	@<buckket https://buckket.org/twtxt.txt> looks nice ;)

Retrieve a list of all tweets with a specific tag like #twtxt (e.g. https://registry.twtxt.org/api/plain/tags/twtxt):

$ curl http://localhost:8080/api/plain/tags/twtxt
@<dracoblue https://dracoblue.net/twtxt.txt>	2016-02-06T21:32:02.000Z	@erlehmann is messing with timestamps in @buckket #twtxt :)
@<dracoblue https://dracoblue.net/twtxt.txt>	2016-02-06T12:14:18.000Z	Simple nodejs script to convert your twitter timeline to twtxt: https://t.co/txnWsC5jvA ( find my #twtxt at https://t.co/uN1KDXwJ8B )

Search for users in the Registry (e.g. https://registry.twtxt.org/api/plain/users?q=dracoblue):

$ curl http://localhost:8080/api/plain/users?q=dracoblue
<@dracoblue https://dracoblue.net/twtxt.txt>	2016-02-09T12:42:26.000Z	dracoblue

License

This work is copyright by DracoBlue (http://dracoblue.net) and licensed under the terms of MIT License.