twtxt.el
is a twtxt client for Emacs.
You can publish posts, view your follower timeline, read and reply to threads, view profiles, see when you are mentioned and write direct messages.
You will not need to use the official terminal client or other complex solutions to interact with the community. Where you go with Emacs, you go with twtxt.
- Publish posts (twts).
- Read chronologically the publications of those you follow.
- Notifications of mentions.
- Read and write in threads.
- View profiles.
- Mention, and notify, other users.
- Transform Markdown syntax to Org.
Feature | Status |
---|---|
Twt Hash | ✅ |
Twt Subject | ✅ |
Multiline | ✅ |
User-Agent | ✅ |
Metadata | ✅ |
Archive Feeds | ❌ |
WebFinger | ❌ |
Direct Message | ❌ |
The extensions that it does not support are due to its desktop client nature.
twtxt
is available from
Melpa. After setting up Melpa
as a repository and update the local package list, you can install
twtxt
and its dependencies using M-x package-install twtxt
.
Add twtxt to your load-path
and require. Something like:
(add-to-list 'load-path "path/to/twtxt/")
(require 'twtxt)
(setq twtxt-file "~/my/twtxt") ;; Path to twtxt file. Default "~/twtxt"
If you don’t have a twtxt file yet, you can create one using this template:
# Learn more about twtxt:
# https://twtxt.readthedocs.io/en/stable/
#
# nick = Foo
# url = https://example.org/twtxt.txt
# avatar = https://example.org/avatar.jpg
# description = I'm a hacker
Open the timeline buffer with M-x twtxt-timeline
.
Post a tweet with M-x twtxt-post
.
(setq twtxt--twtxts-per-page 10) ;; Number of twts per page. Default 10
(setq twtxt-max-twts-per-feed 20) ;; Max twts per feed. Default 20. Set `nil` to get all twts.
You can use the following hooks to perform additional actions automatically:
Name | Description |
---|---|
twtxt-mode-hook | Hook run after enabling twtxt-mode . |
twtxt-post-tweet-hook | Hook run after posting a tweet. |
twtxt-after-fetch-posts-hook | Hook run after fetching posts. |
For example, upload your twtxt file to a server or execute other commands. Configure it as follows:
;; Example: Upload twtxt file to a remote server using scp: scp twtxt.txt user@server:/your/path/twtxt.txt
(add-hook 'twtxt-post-tweet-hook (lambda () (call-process-shell-command (format "scp %s %s"
twtxt-file
"user@server:/your/path/twtxt.txt"
) nil 0)))
Or maybe you want to disable the spell checker:
(add-hook 'twtxt-mode-hook (lambda () (flyspell-mode -1)))
You should add your followers to the twtxt-file
.
# Learn more about twtxt:
# https://twtxt.readthedocs.io/en/stable/
#
# nick = Foo
#
# ...
#
# follower = user https://example.org/twtxt.txt
# follower = user2 https://example-2.org/twtxt.txt
You can read more about the threads
specification in the extension.
Optionally, if you want to replicate a post, you need to install the following unix tools:
b2sum
awk
xxd
base32
tr
tail
Otherwise you will only be able to replicate existing threads, not create them.
You can read more about the follower
specification in the extension.
If you have pandoc
installed, twtxt.el
will convert the markdown to org mode.
If you have a lot of followers, fetching posts can be slow. The client is full of optimizations to remedy this, such as asynchronous fetching, avatar caching, calculations that are performed only when the data is being viewed, and other tricks. Unfortunately, Emacs has to perform time-consuming tasks such as sorting and interface construction. These tasks depend on your computing power.
If you want to improve speed you will have to:
- Reduce the number of followers.
- Reduce the number of posts per page.
- Reduce the number of posts per feed.
I hope you can improve the performance. Enjoy!
IRC #twtxt-el in irc.libera.chat (my nick is @andros_dev
)