Skip to content

read-only bandwidth-friendly frontend to Twitter tweets

License

Notifications You must be signed in to change notification settings

jimd1989/bitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I don't like Twitter; it's over-engineered and everybody there is really unpleasant. It would be easy enough to ignore if it weren't so essential. Somewhere along the line journalists stopped writing actual articles and started stringing tweets together instead. All roads lead to Twitter if you want to keep on top of current events.

I wrote bitter (the Kiwi pronunciation of "better") to make the process of reading a tweet you've been linked to as painless as possible. It's an API with a simple web frontend that returns tweets (and attached media) as HTML, JSON, or plaintext. It's a lot easier on your bandwidth and strips away all "engagement" options such as liking, retweeting, or even seeing who responded to the tweet. It gets you in and out of the Twitterverse with your sanity intact.

Of course the ultimate solution is to simply stop caring about the news, but I'm not quite there yet.

Installation

You will need Go to build bitter. You will also need a Twitter developer account and Bearer Token, which you should set as the value of TOKEN in html.go before building.

The process:

  • edit TOKEN in html.go
  • if bitter is running behind something like proxy_pass on your server, you should also edit <form action="/"> in html.go to the appropriate path
  • make
  • make install (may have to be root)
  • make uninstall (to remove)

Usage

bitter is invoked as:

bitter port

where port is the port bitter listens for connections.

API

An HTML frontend is available when bitter is called with no parameters. It should be self-explanatory:

https://bitter-url

bitter accepts two GET parameters: url= and format=. url= is a tweet URL of the form:

https://twitter.com/username/status/id

and format= is either "html" for HTML output or "json" for JSON output. If format= is blank, it will respond with the tweet in an easily-parsed plaintext format, which may be better for command-line scripts that have no JSON facilities installed.

All media is returned as a link, so readers don't have to dip into their bandwidth unless they want to. Images are directly linked to, while videos link back to Twitter itself. Users are encouraged to paste the video link in mpv to avoid this.

Demo

You can try bitter here, but the Twitter API limits a given token to a certain number of requests per hour. I encourage you to run your own instance instead.

About

read-only bandwidth-friendly frontend to Twitter tweets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published