Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dsgriffin/opensea-sales-x-bot
An X bot that tweets all OpenSea sales for a given contract 🌊
https://github.com/dsgriffin/opensea-sales-x-bot
ethereum nfts opensea x-bot
Last synced: 5 days ago
JSON representation
An X bot that tweets all OpenSea sales for a given contract 🌊
- Host: GitHub
- URL: https://github.com/dsgriffin/opensea-sales-x-bot
- Owner: dsgriffin
- License: mit
- Created: 2021-05-31T11:31:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-19T19:05:26.000Z (about 2 months ago)
- Last Synced: 2025-01-26T08:04:18.430Z (12 days ago)
- Topics: ethereum, nfts, opensea, x-bot
- Language: JavaScript
- Homepage:
- Size: 72.3 KB
- Stars: 194
- Watchers: 10
- Forks: 288
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenSea Sales X Bot 🌊
A simple bot that monitors Opensea sales for a given collection & then posts them to X.
## ⚠️ Want to include sales from other markets (X2Y2, LooksRare etc.)? ⚠️
To track sales across multiple marketplaces (X2Y2, LooksRare etc.), use my new bot [NFT Sales X Bot](https://github.com/dsgriffin/nft-sales-x-bot) instead.
## Requirements
- [X Developer Account](https://developer.x.com/)
- An OpenSea API Key (request one [here](https://docs.opensea.io/reference/api-overview))
- A Heroku Account; a free account should be ok if you tweak the project to run less often than every minute (by default it is every minute), otherwise a $7 a month dyno instance is more than enough
## Setup
- Clone/Fork/Copy this project to your local public/private git repo
- Create an X Developer App (make sure you change it to have both read/write permissions)
- Create a new Heroku app & set it as a remote branch of your git repo (see [Heroku Remote](https://devcenter.heroku.com/articles/git#creating-a-heroku-remote))
- Make sure you are logged in to the X account you want the bot to run on (as the next step will be authorizing the bot to post on your account)
- Install [Twurl](https://github.com/twitter/twurl) and, using your X Developer consumer key & secret, generate the access token & access secret
In the Settings section of your Heroku app you'll see a Config Vars section. Add the following config vars:
- **CONSUMER_KEY** - Your X Developer App's Consumer Key
- **CONSUMER_SECRET** - Your X Developer App's Consumer Secret
- **ACCESS_TOKEN_KEY** - The Access Token Key of the X Account your bot is posting from
- **ACCESS_TOKEN_SECRET** - The Access Token Secret of the X Account your bot is posting from
- **OPENSEA_COLLECTION_SLUG** - The OpenSea collection name you wish to track (e.g. `cryptopunks`)
- **X_API_KEY** - Your unique OpenSea API keyNow you're ready to release - just push up the code via. git to the Heroku remote (see [Heroku Remote](https://devcenter.heroku.com/articles/git#creating-a-heroku-remote) if unsure how).
Make sure you are using `worker` dynos and not `web` dynos - you can set this in the CLI your project with:
```sh
heroku ps:scale web=0
heroku ps:scale worker=1
```## Modification
By default I am just include the name, price in eth & usd, a hashtag or two and a link to the NFT on OpenSea. Check out the [OpenSea Events API](https://docs.opensea.io/reference#retrieving-asset-events) if you want to include additional info (such as seller/buyer addresses etc.).
There is `tweetWithImage` function that you can use instead of the default `tweet` method if you prefer - this will display the full image file as part of the tweet, instead of the standard OpenSea preview image.
In `app.js`, on line 24 you can see there's a commented out conditional if you'd like to only tweet out sales above a certain amount of Eth.
As mentioned at the top of the README, it runs every 60 seconds by default - you can change this to run less often if you'd like to keep it on a free Heroku instance.
## Contributing
If you've found a bug or have an idea, feel free to open an Issue. If you've got a fix or feature ready, open a PR. Thanks!
## License
MIT