Idered / chalk.ist

📷 Create beautiful images of your source code
https://chalk.ist
MIT License
944 stars 80 forks source link

Get the image and name for twitter badge by twitter username #9

Open celeroncoder opened 2 years ago

celeroncoder commented 2 years ago

The Problem

Right now, to add the Twitter badge we need to add the username and name and select the photo from the local fileSystem, which is inconvenient and time-consuming.

The Solution

We get the photograph and name and the photo using Twitter's API and only prompt the user for a username.

We make a request to an API that takes a username and returns the desired output like the display name and the photo URL.

Example

Visit the Request and Response on HopScotch here.

curl "https://we1b01.sse.codesandbox.io/api/v1/getUser/celeroncoder"

output:

{
  "name":"🇺🇦 Khushal Bhardwaj",
  "id":"1319516729999962112",
  "profile_image_url":"https://pbs.twimg.com/profile_images/1396480350071627781/E9cTACTf_normal.png",
  "verified":false,
  "username":"CeleronCoder"
}

I created a custom express API that does the above visit the codesandbox

I wish to work on this issue if you allow 😊.

I also wish to work on this project actively with you, DM me on Twitter if you want to discuss it with me.

FotieMConstant commented 2 years ago

Hi @celeronCoder great point you made here, absolutely agree with you. and also i think giving the possibility to the user to pick his/her photo from their local disk is still a good thing to consider, personally think it opens room to more flexibility

celeroncoder commented 2 years ago

@FotieMConstant, That's actually great but I think that we should make the default one their Twitter profile picture so that it's much easier for someone who wanna use the same one. We can achieve this fairly easy since we already have the selection from the local disk already just need to set up the default one!

FotieMConstant commented 2 years ago

@FotieMConstant, That's actually great but I think that we should make the default one their Twitter profile picture so that it's much easier for someone who wanna use the same one. We can achieve this fairly easy since we already have the selection from the local disk already just need to set up the default one!

i agree with you a 100%

FotieMConstant commented 2 years ago

@Idered I think this is a good feature to consider.