TBM – Twitter Bookmark Manager
Fetch all your bookmarked tweets and make them accessible through a webinterface.
(Search for bookmarked tweets)
Table of Contents
Features
- Fetch all bookmarked tweets
- Search for all bookmarked tweets containing a given phrase (this includes: username, real name, hashtag, tweet content and real urls)
Usage
In order to fetch your bookmarks, you’ll have to supply an active access token with a matching cookie. You can get both by the following steps:
- Login to twitter.com and go to https://twitter.com/i/bookmarks
- Press
f12
, switch to theNetwork
tab and look for a request namedBookmarks?variables=%7B%22count%22%3A20..
- Switch to the
Headers
tab if it isn’t selected and scroll down toRequest Headers
- Copy the line starting with
cookie:
andauthorization: Bearer
- Check if the
section
has changed (part of the url in front ofBookmarks?variables=%7B%22count%22%3A20..
), if so copy it as well
Usage of tbm:
-access-token string
Twitter bearer access token
-config string
Application config file (default "./config/config.json")
-cookie string
Twitter cookie string
-data-dir string
Folder containing all fetched data (default "./data")
-host string
Host address the api should bind to (default "localhost")
-port uint
Port the api should bind to (default 4788)
-section string
Twitter bookmark api section name (default "BvX-1Exs_MDBeKAedv2T_w")
-timezone string
Application time zone (default "UTC")
-version
Show version and exit
Configuration
Besides the command arguments, you can also provide a config file:
{
"timezone": "UTC",
"data_dir": "./data",
"server": {
"host": "localhost",
"port": 4788
},
"scraper": {
"section": "BvX-1Exs_MDBeKAedv2T_w",
"cookie": "guest_id=...",
"access_token": "AAAAA..."
}
}
Websocket commands
The websocket can be accessed under ws://{host}:{port}/ws
.
Set the access token and cookie:
{
"command":"set_tokens",
"payload":{
"cookie": "guest_id=...",
"access_token": "AAAAA..."
}
}
Get all tweets:
{
"command":"get_tweets",
"payload":{}
}
Search for tweets containing the search query:
{
"command":"search_tweets",
"payload":{
"query": "foo bar"
}
}
Custom Styles
By default all assets (.js, .css, .html, etc) get included while building a new version.
Structure:
- gui
- css
- tailwind.css
- css
- public
- css
- tailwind.css (compiled tailwind css)
- style.css (custom styling)
- js
- app.js
- index.html
- css
Development
Requirements:
Node
v12.13Golang
^1.17.2
npm run watch
npm run build
go run main.go
Build
Build a new release:
./build.sh
Build a new regular binary:
go build -ldflags "-w -s -X main.buildNumber=1 -X main.buildVersion=custom" -o tbm
Features & pull requests
Everyone can contribute to this project. Every pull request will be considered, but it can also happen to be declined. To prevent unnecessary work, please consider to create a feature issue first, if you’re planning to do bigger changes. Of course, you can also create a new feature issue if you’re just wishing a feature 😉
Off-topic, rude or abusive issues will be deleted without any notice.
Support
If you encounter any problems or if you find a bug, please don’t hesitate to create a new issue. However, please be aware that it might take some time to get an answer.
If you need immediate or commercial support, feel free to send me a mail at [email protected].
Change log
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.