Skip to content

emacsmirror/twtxt

Repository files navigation

twtxt

https://melpa.org/packages/twtxt-badge.svg https://img.shields.io/badge/GNU%20Emacs-25.1-b48ead.svg

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.

./screenshots/screenshot-1.jpg

./screenshots/screenshot-2.jpg

./screenshots/screenshot-3.jpg

./screenshots/screenshot-4.jpg

Supported extensions:

FeatureStatus
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.

Install

Melpa

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.

Manually

Add twtxt to your load-path and require. Something like:

(add-to-list 'load-path "path/to/twtxt/")
(require 'twtxt)

Setup

(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

Usage

Open the timeline buffer with M-x twtxt-timeline.

Post a tweet with M-x twtxt-post.

Optional configuration

(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.

Hooks

You can use the following hooks to perform additional actions automatically:

NameDescription
twtxt-mode-hookHook run after enabling twtxt-mode.
twtxt-post-tweet-hookHook run after posting a tweet.
twtxt-after-fetch-posts-hookHook 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)))

Manage followers

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.

Replies

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.

Markdown to org

If you have pandoc installed, twtxt.el will convert the markdown to org mode.

It’s slow when I open the timeline

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!

Get Help or talk with the community

IRC #twtxt-el in irc.libera.chat (my nick is @andros_dev)

About

A twtxt client for Emacs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published

Contributors 3

  •  
  •  
  •