1. 17

Heya folks 👋

Some of you may remember Twtxt back in the day, ~2016, where Felix that went by the Twtxt username of @buckket (he still has a feed! But very rarely posts :/)

Well back in August 2020 I came across the spec and decided I would build something around it. This is it. It is a backend written in Go, that has an API, Web and Mobile App. You can think of it as a multi-user Twxt client, but we call instances of them a “Pod”.

I’d love it if I could get some feedback on what we’ve built, features the backend has or you want to see. I’d also love it if at least one more person spun up their own pod and formed their own community around it like the one I know of at https://twt.u53.net (unfortuantely is pretty idle).

I’m also seeking fellow Gophers who might be interested in helping out with the backend as there’s still quite a lot of work I’d like to get done!

Any because I know this will come up, no, this has nothing to do with the “Fediverse” or Mastodon. Yes it is decentralised because well the Web is :D


  2. 7

    Wasn’t the whole point of twtxt to be as simple as possible? Just a text file to sync with your website root, and you’re done. Want to “follow” someone else? Just pull their txt file from their site!

    This…kinda takes away from that.

    1. 3

      This kind of response comes up a fair bit actually and to be honest I find it a bit of a frustrating stance in my opinion. I do not believe “things” we build in the tech/hacker community should be relegated to a particular “class” of people. Yes Twtxt (the spec / file format) was once touted as a “micro blogging for hackers”, but I saw it as more than that.

      This is what I’ve built, it still used the same spec/format and even interoperates with the existing community (or what was left of it from ~2016).

      Noone says you have to use this particular client/backend of course, you are more than welcome to host your twtxt.txt file somewhere and serve that up. If you also add a avatar.png we’ll pick that up and display it.

      The point is however, everyone else can also join and participate and not have to know a terrible lot about UNIX file systems, How to host a file on a web server Which web hosting company/provider to pick, How do register domain names and how to maintain and keep things working properly.

      The other distinct feature is that we’ve also built an API that lets us have a Mobile App and share in the exact same experience, whilst still being backed with a twtxt.txt file.

      Anyway I’m not here to defend my work, your point is a valid one, but you are free to choose. Let’s see if we can rebuild/grow the Twtxt community in general?

      1. 2

        That’s all fair, but is my point is, is this even twtxt anymore? The whole point of it was a plaintext feed, and the ability to make a new post simply by doing

        printf '%s\t%s' "$(date -Im)" "some message" >> twtxt.txt

        You can’t do that here.

        1. 4

          If it follows the twtxt protocol, interoperates with existing twtxt implementations, and is part of the existing twtxt community, isn’t it twtxt?

          Or is the ability to add a post via printf so fundamentally important, in your opinion, that no client which adds a GUI to post can ever be considered to be “twtxt”?

          I think it would make sense to call this competing client something other than “twtxt” since “twtxt” is the name of the original client too. But saying “this isn’t twtxt because it’s usable by non-programmers” makes no sense to me.

          1. 5

            If it follows the twtxt protocol, interoperates with existing twtxt implementations, and is part of the existing twtxt community, isn’t it twtxt?

            This! ☝️ This is precisely correct. In designing this backend, web app and api (which Goryon the mobile app uses) I was very deliberate in ensuring compatibility with the “existing” Twtxt community, “protocols” (so to speak) and conventions. We ever made a few new conventions that are being adopted 🤗

          2. 2

            Fair point. You actually can, but bare in mind that jointwt/twtxt is a multiuser client/backend effectively with an API.

            Right now you should do this with the API and it would look something like this:

            echo "hello world" | curl -H 'Authorization: ...' -d - https://twtxt.net/api/v1/post

            Or with the command-line client twt simply:

            echo 'hello world' | twt

            However point is you can access the twtxt.txt feed files directly too, but see comment about about being a multi-user backend.

            Make sense? If you want to spin up a pod for yourself, you’re welcome to! But its not designed for a single-user experience per se (although maybe it could be…)

      2. 2

        Not strictly related to the topic, I thought this stnippet might be helpful to those that want to give twtxt a try. Below is a shell script that allows to create a new twtxt entry.

        set -e
        # read is too basic. No editing and no spellcheck.
        # read -p 'tweet: ' entry
        entryfile=`mktemp --suffix=_twtxt`
        # https://twtxt.readthedocs.io/en/stable/user/twtxtfile.html#format-specification
        vim \
                -c 'set statusline=new\ twtxt\ tweet%=characters:\ %o' \
                -c 'set filetype=twtxt' \
                -c 'startinsert!' \
                -c 'set spell' \
        # New line is not allowed. Instead of escaping it, replace with a space.
        entry=`tr '\r\n' ' ' < $entryfile`
        rm $entryfile
        if [ x"$entry" = "x" ]
        now=`date +%FT%T%:z`
        echo "$now\t$entry" >> $twtxtfile

        In my i3 config, I have a shortcut for the above script to display a small window in the middle of the screen.

        bindsym $mod+t                 exec "xterm -class twtxtsh -T twtxtsh -g '120x4+100+400' -fs 20 -e twtxtsh"
        1. 2

          I really like this! I think twtxt will be the next step into alternatives to social media and a nice little script like this (which integrates with i3, bonus points) looks perfect. Thanks for sharing

        2. 1

          This looks pretty neat, but I’m not sure that it actually counts as decentralised. At least as I read the protocol spec, every user has a unique username that is registered with registry.twtxt.org and all hashtags are also sent there. Presumably registry.twtxt.org is also polling everyone else’s feeds to find mentions, which means that it ends up consuming all of the feeds on the Internet as well and so will have similar resource usage to the Twitter back-end systems.

          It would be nice to have a system like this with email-like names (i.e. whoever owns a domain controls that as a namespace for users) and some kind of distributed hash table for tracking hashtags. Mentions are pretty easy to make point-to-point (when your server sees a mention, ping the server that owns the user) but tags either need a single owner for the tag (e.g. the first server to use it) and a rendezvous protocol (how do you find which server is managing a tag so that you can notify them) or a distributed mechanism for sharing everything.

          The nice thing about tags (from an implementation perspective) is that no one really cares if they don’t see all messages with a particular tag immediately. This means you can go really far down the eventual consistency route - if it takes a few hours for a post with a tag to propagate across the network and different nodes see them appear in different orders, no one cares.

          1. 1

            I think you missed some vital points here. a) There is no registry.twtxt.org – In fact that’s not even the domain I run my pod on! b) The web itself is decentralised. Each pod only consumes feeds of what users on that pod follow. c) We already have cross-pod interactions, so the decentralised features actually already work.

            1. 1

              Thanks, I think I am completely misunderstanding how the protocol works. Do you have some documentation on how cross-pod mentions and tags work?

              1. 1

                Sadly I haven’t quite had the time to write proper documentation for the “protocol” – Which is a rather loose term here because the “protocol” is really HTTP here.

                You can in the meantime (while I go write docs to explain how it all works and what we’ve extended about Twtxt in general) this blog post