thtauhid / open-profile

Unified profile to showcase your work.
https://my-open-profile.vercel.app
MIT License
13 stars 14 forks source link

Profile data extractor #60

Open thtauhid opened 1 year ago

thtauhid commented 1 year ago

A method needs to be implemented that will get data from a specified URL.

The implementation will be as follows

  1. User needs to create a repo in their own github profile with the name open-profile-data
  2. They need to create create a file named {username}.json
  3. Alternatively, they can clone this repo and copy data.json to {username.json}
  4. User can edit their data on the json file by their free will.

This is all the interaction that we need from the user side.

Now, we need to create such a data extractor tool that will extract data from https://github.com/{username}/open-profile-data/{username}.json.

The fetched data needs to be parsed into JSON and it should be readily available in src/api

viditagrawal56 commented 1 year ago

Hey @thtauhid, I was trying to fetch data from johndoe.json to see if I am capable to solve this issue and I managed to fetch the data. So I think that I can work on this issue. I will try my best to solve this issue as I have never used the Github API before. Excited to learn something new :) Can you please assign this issue to me.

thtauhid commented 1 year ago

@viditagrawal56 this implementation will not use GitHub API.

I'm assigning this issue to you.

Do let me know if you need help.

viditagrawal56 commented 1 year ago

Hey @thtauhid, I was trying to fetch data from johndoe.json to see if I am capable to solve this issue and I managed to fetch the data. So I think that I can work on this issue. I will try my best to solve this issue as I have never used the Github API before. Excited to learn something new :) Can you please assign this issue to me.

Hey @thtauhid In this comment when I said I fetched the data, I used the github api to fetch the data from johndoe.json by making a get request to the "https://api.github.com/repos/thtauhid/open-profile/contents/data/johndoe.json" url.

Is there an alternative way you want me to use or Is this a valid approach?

thtauhid commented 1 year ago

Hey @thtauhid, I was trying to fetch data from johndoe.json to see if I am capable to solve this issue and I managed to fetch the data. So I think that I can work on this issue. I will try my best to solve this issue as I have never used the Github API before. Excited to learn something new :) Can you please assign this issue to me.

Hey @thtauhid In this comment when I said I fetched the data, I used the github api to fetch the data from johndoe.json by making a get request to the "https://api.github.com/repos/thtauhid/open-profile/contents/data/johndoe.json" url.

Is there an alternative way you want me to use or Is this a valid approach?

That's a good approach. But, I am thinking about the API rate limit. Can you check the free API usage tier for GitHub?

We can try an alternative way to bypass the API rate limiting. We can visit https://raw.githubusercontent.com/{username}/open-profile-data/main/{username}.json and then use it.

Do share your findings and thoughts.

RobertLupas commented 11 months ago

Does this issue still need to be worked on? If yes, I'd like to.

By the way, the GitHub API has these rate limits:

Also, I have a suggestion. You know how you have a repo with your username, used for the profile readme? The open-profile config could be there too. That would be more convenient, as people already have that repo, and don't need to create a new one for just one file.

thtauhid commented 10 months ago

Hi @half-real-SCRACX you are still interested in working on this issue?

RobertLupas commented 10 months ago

Count me in :)

RobertLupas commented 10 months ago

By the way, wouldn't it be better for the user if the open-profile config file would be in the repo with their username (the same used for the profile README)? That way, people wouldn't need to create a separate repo just for open-profile.

Edit: just realized I already suggested this in a reply a bit earlier in the thread

thtauhid commented 10 months ago

By the way, wouldn't it be better for the user if the open-profile config file would be in the repo with their username (the same used for the profile README)? That way, people wouldn't need to create a separate repo just for open-profile.

Edit: just realized I already suggested this in a reply a bit earlier in the thread

So, something like thtauhid/thtauhid/open-profile.json?

thtauhid commented 10 months ago

@half-real-SCRACX your approach sounds cool. Go ahead with this.

thtauhid commented 10 months ago

@half-real-SCRACX I have create https://github.com/thtauhid/thtauhid/blob/main/open-profile.json. You can use this one if you want.

RobertLupas commented 10 months ago

@thtauhid right now I'm really busy, and I'm also having a bit of a hard time implementing the feature (doesn't mean it's impossible 😉). Is it ok if I get it done by tomorrow or the day after tomorrow?

thtauhid commented 10 months ago

@half-real-SCRACX no problem.

RobertLupas commented 10 months ago

@thtauhid I started working on this, but it's giving me a headache. I pretty much remade the API (here's the code). I feel like I've gone in the wrong direction (maybe I'm not fit for this issue). My implementation is not modular (that's how I'd describe it, as adding new data, for example, would be pretty painful), and would require a rewrite of some parts of the UI. Could you take a look, please? If you think I'm not a good fit, I'd be happy to let someone else work on this :)