Giter VIP home page Giter VIP logo

nft-sales-twitter-bot's Introduction

NFT Sales Twitter Bot ๐Ÿค–

This was made to succeed my Opensea Sales Twitter Bot repo; while relying on the OpenSea Events API is simpler, it doesn't include any NFT sales happening in other, newer marketplaces.

So, we need to monitor & process Ethereum event logs for ERC-721 token transactions directly, before posting any sales to Twitter.

Aims ๐ŸŽฏ

The aim is to monitor all sales across Ethereum for a given contract. However, different marketplaces can send sale logs in different formats, so we need to process major market logs manually (see markets.js).

Right now Opensea and LooksRare marketplaces are integrated, but it should be easy to add others in the future.

Donations ๐Ÿ’ต

...are greatly appreciated ๐Ÿ™

Eth Address: 0xDCA88f66CEc8972D23DE7d5e69c40E087C92132f

Setup ๐Ÿ”ง

- abi.json

  • Retrieve the Contract ABI for the contract you're looking to monitor, from somewhere like EtherScan, in JSON format, and include it in abi.json.

- Alchemy (or another Web3 service provider e.g. Infura, Moralis)

  • Create an account at Alchemy.com & create a new application on Ethereum mainnet. Once you've created a project, you should be able to grab the API key for it

- OpenSea (or another service with an NFT metadata API, e.g. Moralis, Venly)

  • Request an OpenSea API key here

- Twitter

  • Request a Twitter Developer Account (with Elevated Access, then create a Twitter Developer App (make sure you change it to have both read/write permissions)

  • Make sure you are logged in to the Twitter account you want the bot to run on (as the next step will be authorizing the bot to post on your account)

  • Install Twurl and, using your Twitter Developer consumer key & secret, generate the access token & access secret

- Heroku

  • Create a new Heroku account + app (a $7 a month dyno instance should be enough but it'll depend on usage) & set the project as a remote branch of your git repo (see Heroku Remote)

In the Settings section of your Heroku app you'll see a Config Vars section. Add the following config vars:

  • CONSUMER_KEY - Your Twitter Developer App's Consumer Key
  • CONSUMER_SECRET - Your Twitter Developer App's Consumer Secret
  • ACCESS_TOKEN_KEY - The Access Token Key of the Twitter Account your bot is posting from
  • ACCESS_TOKEN_SECRET - The Access Token Secret of the Twitter Account your bot is posting from
  • CONTRACT_ADDRESS - The contract address you want to monitor sales for
  • ALCHEMY_API_KEY - Your unique Alchemy API key
  • X_API_KEY - Your unique OpenSea API key

Now you're ready to release - just push up the code via. git to the Heroku remote (see 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:

heroku ps:scale web=0
heroku ps:scale worker=1

Modification ๐Ÿ› 

In app.js, you'll notice there's some commented out logic for only posting sales above a certain threshold that you can modify per-currency in currencies.js.

License ๐Ÿ“ƒ

This code is licensed under the ISC License.

Please include proper attribution to my original repo if you fork, modify or utilize this repo in any way. Thank you!

nft-sales-twitter-bot's People

Contributors

dsgriffin avatar kadestroude avatar

Stargazers

Summsitup.eth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.