Giter VIP home page Giter VIP logo

twitterbot_mintalerts's Introduction

Steps to follow so that you can tailor the example to your specific needs.

Step 0

  • Run yarn add in both the frontend/ and backend/

Step 1

  • Go the backend folder, add the smart contract you want to track under contracts/
  • Open the terminal and run yarn hardhat compile. This will generate the ABI which can be found under the artifacts/contracts/[NAME].json at the root of the backend folder.

Step 2

  • Pre-requisite : The contract should already exist on the chain you are trying to target. Therefore either deploy it using Remix IDE or Hardhat deployments.
  • After done, open frontend/.
  • Open the constants/info.js file and update the contract address and abi variables and add your contract's relevant info which can be found with the help of Step 1.2

Step 3

  • Add a .env file at the root of your frontend/ and add the 4 variables being imported as process.env.* in the api/checkAndUpdate.js under pages/ (These are twitter api's keys generated with each developer account).

Step 4

  • After done with everything open your terminal and run yarn dev. This will start the server which will continue to listen for the event mentioned in the checkAndUpdate API endpoint for the application. (After running the webapp for the first time you need to call the endpoint with POST method to enable the listener which will keep it running until the server is active.)
  • After you'll be done, anytime the MintedToken event (in this example. To change, edit the checkAndUpdate file and make sure you have the event definition in your contract's ABI too.) is emitted the server will call the twitter API and send the tweet congratulating the Twitter Handle mentioned in the event itself.

NOTE : If you wish to make the whole project autonomous you can deploy the app on vercel and send a POST request to its API endpoint and it will ideally start the listener and will make sure everytime someone mints using your contract it will send a tweet to the recepient.

twitterbot_mintalerts's People

Contributors

br0wnd3v avatar

Stargazers

 avatar

Watchers

 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.