Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robot-inventor/twi-ext
Unofficial utility to develop browser extensions for Twitter / X
https://github.com/robot-inventor/twi-ext
Last synced: 24 days ago
JSON representation
Unofficial utility to develop browser extensions for Twitter / X
- Host: GitHub
- URL: https://github.com/robot-inventor/twi-ext
- Owner: Robot-Inventor
- License: mit
- Created: 2023-03-06T15:06:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-11T05:00:36.000Z (7 months ago)
- Last Synced: 2024-04-14T07:09:42.404Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 235 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twi-ext
Unofficial utility to develop browser extensions for Twitter / X.
This package provides a simple API to interact with the Twitter web interface. It allows you to listen to events such as new tweets being added to the timeline, and provides access to the React props of the tweets or user profiles.
It is used to develop [Shadowban Scanner](https://github.com/Robot-Inventor/shadowban-scanner/), a browser extension that helps you detect shadowbans on Twitter, and other extensions.
> [!IMPORTANT]
> This utility works only within page scripts. Running it within a content script may result in an error.> [!WARNING]
> This package is under development and some features are not yet implemented.## Installation
```bash
npm install twi-ext
```## Usage
```typescript
import { Timeline, Tweet } from "twi-ext";const onNewTweet = (tweet: Tweet): void => {
// Get the tweet element.
const tweetElement = tweet.element;
// Get the React props of the tweet.
const props = tweet.props;
};const timeline = new Timeline();
timeline.onNewTweet((tweet) => {
// Do something when a new tweet is added to the timeline.
onNewTweet(tweet);
});
```See the [documentation](./docs/README.md) for more information.
## License
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
## Development
```bash
npm install
```### Build
To build the project and generate the documentation:
```bash
npm run build
```### Format
To format the code:
```bash
npm run format
```### Lint
To lint the code:
```bash
npm run lint
```### Pull Requests
This repository uses [Changesets](https://github.com/changesets/changesets) to manage versioning and releases. When creating a pull request, please run the Changesets CLI and commit the changeset file.
```bash
npx changeset
```