buidl-labs / crypto-code-school-inside-tezos

Interactive Code School for onboarding newcomers to build DApps on Tezos using SmartPy
https://cryptocodeschool.in/tezos
MIT License
47 stars 20 forks source link

Creating twitter bot for showing every nft bot sale and purchase. #192

Open bhaskarSingh opened 3 years ago

bhaskarSingh commented 3 years ago

What's the motivation behind the feature? what problem does the feature intend to solve ? For marketing nft 3d cryptobots on Twitter. It will help with traction.

Describe the solution you'd like. Creating a Twitter bot that will post a tweet for every nft bot purchased or sold.

Prerequisite: saving images of 3d bots with 3d models within token metadata.

bhaskarSingh commented 3 years ago

Prerequisite: saving images of 3d bots with 3d models within token metadata.

Example https://codepen.io/alwxkxk/pen/JjPMyNW

manangouhari commented 3 years ago

Can't seem to figure out how to hook into the canvas element in react-three-fiber using a useRef, it's always coming as undefined. Can you take a look, or do you have any insight to help with this from your experience with it?

bhaskarSingh commented 3 years ago

I have no vantage here. Will have to look into it.

manangouhari commented 3 years ago

I need you to take a look at this @bhaskarSingh. Not able to access the canvas.

manangouhari commented 3 years ago

Q: How's this a constraint for launch btw?

bhaskarSingh commented 3 years ago

Once we launch on mainnet, we would need to make sure that images & 3d models are bing stored for consistency.

On Wed, 3 Mar, 2021, 12:34 am manangouhari, notifications@github.com wrote:

Q: How's this a constraint for launch btw?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/buidl-labs/crypto-code-school-inside-tezos/issues/192#issuecomment-789140512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6YAT3H5NEUP3WUNANN3VTTBUZDBANCNFSM4YJ3KLGQ .

manangouhari commented 3 years ago

Once we launch on mainnet, we would need to make sure that images & 3d models are bing stored for consistency.

Right, but we're anyway storing 3d models. Images can be generated later on as well.

bhaskarSingh commented 3 years ago

Hmm. Okay.

manangouhari commented 3 years ago

What's the verdict for now? Need to tackle this or not?

bhaskarSingh commented 3 years ago

Try to figure it out today & tomorrow. If still no progress, then leave it.

On Wed, 3 Mar, 2021, 5:01 pm manangouhari, notifications@github.com wrote:

What's the verdict for now? Need to tackle this or not?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/buidl-labs/crypto-code-school-inside-tezos/issues/192#issuecomment-789648429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6YAT3SRWJIDSV3FRKDZD3TBYMY7ANCNFSM4YJ3KLGQ .

manangouhari commented 3 years ago

Okay. Is there anything else that needs to be done before launch or are we good to go apart from this?

manangouhari commented 3 years ago

Should be doable now. Found out how to do it, thanks to https://twitter.com/manangouhari/status/1367103948377628674?s=19

manangouhari commented 3 years ago

@bhaskarSingh this is the closest I have come to saving the bot images to IPFS - Bot Image

Try putting this string from IPFS in this tool and you'll see the image.

When we do make a twitter bot, this base64 encoded string of the image should be good enough.

Thoughts?

bhaskarSingh commented 3 years ago

When we do make a Twitter bot, this base64 encoded string of the image should be good enough.

Any idea why this is happening.

manangouhari commented 3 years ago

When we do make a Twitter bot, this base64 encoded string of the image should be good enough.

Any idea why this is happening.

What do you by "this?"

bhaskarSingh commented 3 years ago

What do you by "this?"

Why getting base64 & not the actual image

Can you check how to convert base64 to image in nodejs. It's better to store the image if so much progress has already been made.

bhaskarSingh commented 3 years ago

@manangouhari can you create an API endpoint for uploading JSON on IPFS with the following data attached to it.

{
"name": "3D Cryptobot",
"symbol": "CB",
"decimals": 0,
"description": "Custom made NFT 3d cryptobot",
"isBooleanAmount": true,
"isTransferable": true,
"shouldPreferSymbol": false,
"language": "en",
"tags": ["3D model", "Collectables", "NFT", "Cryptobot"],
"attributes": [  {
    "color_schema": {"": ""},
    "body_parts_type": {"": ""} 
  }  ], 
"externalUri": "https://cryptocodeschool.in/tezos/",
"artifactUri": "<insert-3d-model-ipfs-url-here>",
"displayUri": "<insert-3d-model-ipfs-image-url-here>"
}

This is the only metadata we need to attach to the token_metadata according to the zip-21 (https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-21/tzip-21.md#displayuri-string-format-uri-reference)

manangouhari commented 3 years ago

What do you by "this?"

Why getting base64 & not the actual image

Can you check how to convert base64 to image in nodejs. It's better to store the image if so much progress has already been made.

An image is represented as a stream of bytes in a program. It gets converted to an image, when you write it to a file(using the fs module), then it shows like an image. I feel, doing this for our use-case is not the most efficient way to do it, and base64 string of the image is the way to go.

manangouhari commented 3 years ago

@manangouhari can you create an API endpoint for uploading JSON on IPFS with the following data attached to it.

{
"name": "3D Cryptobot",
"symbol": "CB",
"decimals": 0,
"description": "Custom made NFT 3d cryptobot",
"isBooleanAmount": true,
"isTransferable": true,
"shouldPreferSymbol": false,
"language": "en",
"tags": ["3D model", "Collectables", "NFT", "Cryptobot"],
"attributes": [  {
    "color_schema": {"": ""},
    "body_parts_type": {"": ""} 
  }  ], 
"externalUri": "https://cryptocodeschool.in/tezos/",
"artifactUri": "<insert-3d-model-ipfs-url-here>",
"displayUri": "<insert-3d-model-ipfs-image-url-here>"
}

This is the only metadata we need to attach to the token_metadata according to the zip-21 (https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-21/tzip-21.md#displayuri-string-format-uri-reference)

Sure. Will do. Please create an issue for it in the backend repo.

prastut commented 3 years ago

Q: How's this a constraint for launch btw?

This was an extremely good question asked my @manangouhari.

@bhaskarSingh feedback, it was an incorrect call at your end to prioritize this.