Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Webklex/tbm

Fetch all your bookmarked tweets and make them accessible through a webinterface.
https://github.com/Webklex/tbm

Last synced: about 1 month ago
JSON representation

Fetch all your bookmarked tweets and make them accessible through a webinterface.

Awesome Lists containing this project

README

        

# TBM - Twitter Bookmark Manager

Fetch all your bookmarked tweets and make them accessible through a webinterface.

[![Releases][ico-release]](https://github.com/Webklex/tbm/releases)
[![Downloads][ico-downloads]](https://github.com/Webklex/tbm/releases)
[![License][ico-license]](LICENSE.md)
[![Hits][ico-hits]][link-hits]

![Search Tweets](.github/images/search_tweets.png)
(Search for bookmarked tweets)

## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [Modes](#modes)
- [Api](#websocket-commands)
- [Build](#build)
- [Development](#development)
- [Custom Styles](#custom-styles)
- [Structure](#structure)
- [Support](#support)
- [Change log](#change-log)
- [Security](#security)
- [Credits](#credits)
- [License](#license)

## 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)

## Installation
You can either download a matching prebuild binary and config from the [releases](https://github.com/Webklex/tbm/releases)
or clone this repository and [build](#build) it yourself.

## Usage
In order to fetch your bookmarks, you'll have to supply an active cookie.
You can find it by following these steps:
1. Login to twitter.com and press `f12`, switch to the `Network` tab
2. Go to https://twitter.com/i/bookmarks and look for a request named `Bookmarks?variables=%7B%22count%22%3A20..` inside your open network tab
3. Click on the request and switch to the `Headers` tab if it isn't selected and scroll down to `Request Headers`
4. Copy the line starting with `cookie: `. Make sure to enclose the entire cookie string in quotes (`"`). Escape possible quotes on key:values pairs inside the cookie as `\"`.

```bash
-config string
Application config file (default "./config.json")
-offline
Don't fetch new bookmarks; link to local files only
-cookie string
Twitter cookie string
-data-dir string
Folder containing all fetched data (default "./data")
-delay duration
Delay your request by a given time (default 30s)
-host string
Host address the api should bind to (default "localhost")
-port uint
Port the api should bind to (default 4788)
-timeout duration
Request timeout (default 10s)
-timezone string
Application time zone (default "UTC")
-danger-remove-bookmarks
Remove the bookmark on Twitter if the tweet has been downloaded
-log int
Set the log mode (0 = all, 1 = success, 2 = warning, 3 = statistic, 4 = error)
-no-color
Disable color output
-version
Show version and exit
-help
Show help and exit
```

## Configuration
Besides the command arguments, you can also provide a config file:
```json
{
"timezone": "UTC",
"data_dir": "./data",
"mode": "online",
"danger": {
"remove_bookmarks": false
},
"server": {
"host": "localhost",
"port": 4788
},
"scraper": {
"delay": "30s",
"cookie": "guest_id=..."
}
}
```

### Modes
There are currently two different modes available. `online` and `offline`. If you enable
`offline` mode, the program won't fetch any new bookmarks and only reference previously downloaded
resources such as tweets and media files.

If you want to restart your sync, stop the application and delete the file called `.cursor.tmp` located in your
working directory.

## Websocket
The websocket can be accessed under `ws://{host}:{port}/ws`.

## Build
Build a new regular binary:
```bash
go build -ldflags "-w -s -X main.buildNumber=1 -X main.buildVersion=custom" -o tbm
```

## Development
Requirements:
- `Node` v12.13
- `Golang` ^1.17.2

```bash
npm run watch
npm run build
go run main.go
```

## Custom Styles
By default all assets (.js, .css, .tmpl, etc) get included while building a new version.

### Structure:
- static
- assets
- css
- tailwind.css
- template
- css
- tailwind.css (compiled tailwind css)
- style.css (custom styling)
- js
- app.js

## 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](https://github.com/webklex/tbm/issues/new?template=feature_request.md)
first, if you're planning to do bigger changes. Of course, you can also create a new [feature issue](https://github.com/webklex/tbm/issues/new?template=feature_request.md)
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](https://github.com/webklex/tbm/issues).
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](CHANGELOG.md) 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
- [Webklex][link-author]
- [All Contributors][link-contributors]

## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-release]: https://img.shields.io/github/v/release/webklex/tbm?style=flat-square
[ico-downloads]: https://img.shields.io/github/downloads/webklex/tbm/total?style=flat-square
[ico-hits]: https://hits.webklex.com/svg/webklex/tbm?1

[link-hits]: https://hits.webklex.com
[link-author]: https://github.com/webklex
[link-contributors]: https://github.com/webklex/tbm/graphs/contributors