Cyfrin / foundry-full-course-cu

GNU General Public License v3.0
3.42k stars 831 forks source link

Twitter bot that congratulates people when they mint an arbitrum NFT #13

Closed PatrickAlphaC closed 1 year ago

PatrickAlphaC commented 1 year ago

Describe the enhancement

Our NFTs allow people to add their twitter handle, it would be awesome if we had a bot tweet to someone's handle whenever they minted an NFT!

Here is the contract: https://arbiscan.io/address/0x39338138414Df90EC67dC2EE046ab78BcD4F56D9#code

Additionally, having a website that shows a real-time list of people minting would be awesome.

I'm down to pay someone to work on this as well!

shankars99 commented 1 year ago

I could try out the bot as soon as I get my Chainlink Spring Hackathon submission up (so in like a few days) if that works

PatrickAlphaC commented 1 year ago

@shankars99

That works lovely!

lostintime101 commented 1 year ago

Would also be interested in putting this together. Cool little project

Nkemjieme commented 1 year ago

Here's an outline of the steps you can follow to implement this enhancement:

Set up a Twitter Developer Account: To access the Twitter API, you'll need to create a developer account and set up a Twitter App. This will provide you with the necessary API keys and access tokens to authenticate your requests.

Install Twitter API Client Library: Use a Twitter API client library in your preferred programming language (such as Tweepy for Python) to simplify the interaction with the Twitter API. You'll need to install the library and configure it with your API keys and access tokens.

Write the Mint Event Listener: In your smart contract, add an event listener for the "mint" event. Whenever a new NFT is minted, emit this event with the necessary information, such as the owner's Twitter handle.

Connect the Backend and Smart Contract: In your backend application (Flask), set up a listener for the "mint" event using the appropriate Ethereum library (such as Web3.py). When the event is triggered, retrieve the necessary information and call the Twitter API to send a tweet to the specified Twitter handle.

Real-time List of People Minting: To display a real-time list of people minting NFTs, you can use WebSockets or a similar technology to establish a bi-directional communication channel between the backend and the frontend. Whenever a new "mint" event is received in the backend, send the updated list of minted NFTs to the frontend through the WebSocket connection.

Update the Frontend: In your frontend application (React), subscribe to the WebSocket connection to receive the real-time updates of minted NFTs. Update the list displayed on the website whenever a new NFT is minted.

egeaybars123 commented 1 year ago

Working on it.

d1-dblaze commented 1 year ago

Hey, I'm interested. I will like to work with someone on this. Kindly check my bio and dm me on twitter.

0xAnon0602 commented 1 year ago

Working on this

RomitoVincenzo commented 1 year ago

Hi guys, here to help!

Ankur-Thakur-NEU commented 1 year ago

Hey Patrick. I'd be really interested in working on this.

michealfortunatus commented 1 year ago

Let's get it started

I am taking up this

kanvgupta commented 1 year ago

Deployed a local version here https://twitter.com/matic_eth (Tested with Uniswap's Transfer events)

Let me know if you want me to finish this

0xAnon0602 commented 1 year ago

@PatrickAlphaC Was able to get this working https://github.com/0xAnon0602/Foundery-Course-Twitter-Bot

usman-2000 commented 1 year ago

it's time to dig hands on this project. I am going to start working on this project.

Markeljan commented 1 year ago

Had some fun with this. (and some not fun dealing with Twitter API)

Frontend Trackoor

Twitter Bot

Backend node.js service running on Amazon EC2.

Repositoory

tormentr commented 1 year ago

To those on this project , is the free API , being used for this ? the lowest tier is at 100USD a month .. ?

turazashvili commented 1 year ago

If by any chance this is what you wanted to see - let me know :) https://twitter.com/axrisi/status/1667874938928111617

egeaybars123 commented 1 year ago

Done! Frontend Link: https://arb-nft-frontend.vercel.app/ Twitter Bot: https://twitter.com/FoundryCongrats

Our bot is NOT working locally. We created a MongoDB database and a NodeJs script which is deployed in a cloud server.

PatrickAlphaC commented 1 year ago

Going to close this issue for now, as a few people made an MVP and they all look cool! Looking at them all now.

PatrickAlphaC commented 1 year ago

@kanvgupta @0xAnon0602 @0xn4de @Markeljan @egeaybars123

Let's DM - I'm @PatrickAlphaC on telegram. Everyone else please stop working on this!

RichardPalladino commented 1 year ago

(I'm running an Arbitrum node, if people feel like getting the bot to query the blockchain for free... not sure what your polling rate / RPC consumption is going to be.)

Muhammad-Shahrukh-Azeem commented 1 year ago

Describe the enhancement

Our NFTs allow people to add their twitter handle, it would be awesome if we had a bot tweet to someone's handle whenever they minted an NFT!

Here is the contract: https://arbiscan.io/address/0x39338138414Df90EC67dC2EE046ab78BcD4F56D9#code

Additionally, having a website that shows a real-time list of people minting would be awesome.

I'm down to pay someone to work on this as well!

I would love to do this.

RichardPalladino commented 1 year ago

You guys are RAD! Super fast turnaround. I just minted a couple NFTs and wouldn't you know it got instantly posted to Twitter.