twtwt — a client for twtxt: decentralized, minimalist microblogging service for hackers.
pkg-config
/pkgconf
and GNU make
are required for building using Makefile
.
curl/curl.h
and ini.h
headers are required for building twtwt from source.
- Debian/Ubuntu:
libinih1 libinih-dev libcurl4 libcurl4-openssl-dev
- Fedora:
inih inih-devel libcurl libcurl-devel
- macOS:
curl inih
- FreeBSD:
curl inih
make # GNU make should be used
make install # will install to /usr/local; may require superuser privileges
You can pass PREFIX
or DESTDIR
to make
:
make PREFIX=/usr
make PREFIX=/usr install # may require superuser privileges
doas make uninstall # note: doas is modern sudo
At the first startup, the quickstart wizard will be started, that will help you to configure twtwt.
The quickstart wizard prompts for the following configuration values:
- Your desired nickname
- Location of your twtxt.txt file on the computer
- The URL your twtxt.txt file will be accessible from remotely
Add a new source to your followings:
$ twtwt follow win0err https://kolesnikov.se/twtxt.txt
You're now following win0err (https://kolesnikov.se/twtxt.txt)
Show the list of sources you are following:
$ twtwt following
win0err @ https://kolesnikov.se/twtxt.txt
Remove an existing source from your followings:
$ twtwt unfollow win0err
You've unfollowed win0err (https://kolesnikov.se/twtxt.txt)
Append a new tweet to your twtxt.txt file:
$ twtwt tweet "Hello, world! :-)"
If pull_command
is set in the configuration file, it will be executed before tweeting.
If push_command
is set, it will be executed after tweeting.
If you're following the user you want to mention, you can use short mentions that will be automatically expanded:
$ twtwt following
bob @ https://example.com/bob.txt
$ twtwt tweet "@bob: Have you tried twtwt?"
$ tail -n1 ~/twtxt.txt
2023-01-21T14:38:41+03:00 @<bob https://example.com/bob.txt>: Have you tried twtwt?
Otherwise, you have to write a full mention in the tweet:
$ twtwt tweet "@<alice https://example.com/alice.txt>: How often does it rain in St. Petersburg?"
$ tail -n1 ~/twtxt.txt
2023-01-21T14:39:15+03:00 @<alice https://example.com/alice.txt>: How often does it rain in St. Petersburg?
You can edit your twtxt.txt file running:
$ twtwt file edit
# opens $EDITOR (nano if the env. variable is unset)
You may want to sync txtxt.txt file after editing:
$ twtwt file pull # executes pull_command, see Configuration section
scp twtwt@kolesnikov.se:/path/on/remote/server/twtxt.txt ~/twtxt.txt
twtxt.txt 100% 6350 63.2KB/s 00:00
$ twtwt file push # executes push_command, see Configuration section
scp ~/twtxt.txt twtwt@kolesnikov.se:/path/on/remote/server/twtxt.txt
twtxt.txt 100% 6350 120.8KB/s 00:00
twtwt timeline
and twtwt view
commands are used to view your personal timeline or feed of a specific source.
Both commands support the -l
(limit) and -p
(page) flags.
For example, twtwt timeline
will display the last 20 posts in your timeline.
To see the next (earlier) posts, use the -p
flag: twtwt timeline -p2
.
The twtwt timeline -l5
command will show the last 5 posts in your feed.
To see the next (earlier) 5 posts: twtwt timeline -l5 -p2
.
To see all available posts, set the limit to 0
: twtwt view https://kolesnikov.se/twtxt.txt -l0
.
$ twtwt timeline
bob wrote on 21 Jan 2023, 14:42:
There will be an answer... Let it be... Let it be
alice wrote on 21 Jan 2023, 14:43:
@<bob https://example.com/bob.txt>: Let it B, let it B, let it C, let it D...
$ twtwt view https://kolesnikov.se/twtxt.txt
https://kolesnikov.se/twtxt.txt wrote on 18 Mar 2022, 03:20:
Hello world!
...
If you are following the user whose feed you want to view, you can use nick instead of URL:
$ twtwt view win0err
win0err wrote on 18 Mar 2022, 03:20:
Hello world!
...
$ twtwt config
# opens $EDITOR (nano if the variable is unset)
To show program version, use: twtwt -v
.
To show available commands, use: twtwt -h
.
Config can be edited using twtwt config
command.
Locations of the configuration file:
- macOS:
~/Library/Application Support/twtwt/twtwt.conf
- Linux/BSD:
~/.config/twtwt/twtwt.conf
Example of a configuration file:
[twtxt]
nick = win0err
twtfile = ~/twtxt.txt
twturl = https://kolesnikov.se/twtxt.txt
pull_command = scp twtwt@kolesnikov.se:/path/on/remote/server/twtxt.txt ~/twtxt.txt
push_command = scp ~/twtxt.txt twtwt@kolesnikov.se:/path/on/remote/server/twtxt.txt
[following]
win0err = https://kolesnikov.se/twtxt.txt
pull_command
and push_command
are very useful if you want to push your twtxt file to a remote (web) server.
nick
: your nick, will be displayed in your timelinetwtfile
: path to your local twtxt filetwturl
: URL to your public twtxt filepull_command
: command to be executed before tweeting and when running commandtwtwt file pull
push_command
: command to be executed after tweeting and when running commandtwtwt file push
This section holds all your followings as nick and URL pairs. You can edit this section manually or use the follow
/unfollow
commands.
Developed by Sergei Kolesnikov