GithubHelp home page GithubHelp logo

Comments (24)

rahuldkjain avatar rahuldkjain commented on May 21, 2024 1

@ankurchaudhary627 showing stars count in star this repo button and forks count in fork on github button

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024 1

I was looking into this, can you assign this to me it might be worth saving time to convert the file to class component. I am going to use useEffect.

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024 1

@rahuldkjain I'm having some issues using useEffect as I'm not experienced in it. Can I convert the src/components/header.js to a stateful class component and use componentDidMount instead?

P.S. I need to make an API call to GitHub API.

@ankurchaudhary627 is working on this. You can pick some other issues.

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024 1

@rahuldkjain I explored github buttons. There are 2 issues in using that, first github button's UI is different from what is already there in the code right now. Secondly, the github button provides static count of stars and forks, and we don't have control to update those.
Right now I'm fetching from github api, and the update is happening dynamically, but there is delay which I'm trying to reduce.
The UI is like this after my changes:
image
There is some css needs to be updated though!

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024 1

I've used the buttons before, but removed it to make UI clean. You can go with your approach

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024 1

I've checked in the code and raised a PR. @rahuldkjain Thanks.

from github-profile-readme-generator.

abhijit-hota avatar abhijit-hota commented on May 21, 2024

Can I work on this?

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024

Can you please elaborate on this issue? I didn't get this one. @rahuldkjain

from github-profile-readme-generator.

abhijit-hota avatar abhijit-hota commented on May 21, 2024

@rahuldkjain I'm having some issues using useEffect as I'm not experienced in it. Can I convert the src/components/header.js to a stateful class component and use componentDidMount instead?

P.S. I need to make an API call to GitHub API.

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024

You can use buttons from https://buttons.github.io/

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024

I see it takes around 40-45 seconds to update the count state, after it's been updated on Github. If that's fine? @rahuldkjain

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024

@ankurchaudhary627 40-45 seconds is too much. If it doesn't work then we will have to use the buttons mentioned above

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024

Okay, I will see how I can reduce it, and let you know! @rahuldkjain

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024

@ankurchaudhary627 any update?

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024

Hi @rahuldkjain , so the issue is with the github api. There's limit on the api calls that we can make with github api. For, getting more number of requests we need to make Oauth get requests.
Right now, i am fetching every 15 seconds to get the updated count for stars and forks.

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024

Any idea how to do the same with the buttons that you mentioned earlier, its giving static count, right? Plus the UI is different from what is there currently

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024

I've used them here https://rahuldkjain.github.io

Its pretty straightforward and I think it won't affect the UI much

from github-profile-readme-generator.

ankurchaudhary627 avatar ankurchaudhary627 commented on May 21, 2024

Isn't the button used there different from this
image
Plus the update isn't real time here - https://rahuldkjain.github.io, update happens when the page reloads.
I was thinking of real time update, instead of reloading.
Right now I am making call after every 15 seconds, but need to use oauth because of the limit. What do you think?

from github-profile-readme-generator.

abhijit-hota avatar abhijit-hota commented on May 21, 2024

Have been looking at this issue for a while.
My two cents:

The counts don't necessarily have to be "real-time". They are just counts and I think a single API fetch after the first render is enough. Making them real-time, in my opinion, is just overkill.

A simple solution would be to make the API call and just display the count like @ankurchaudhary627 did here and just style them to fix their layouts.

from github-profile-readme-generator.

prakashchokalingam avatar prakashchokalingam commented on May 21, 2024

We can use https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event to refresh the counts. I can help you with a PR. @rahuldkjain

When user clicks the fork button, he will be taken to the github in a new tab, after forking when he returns back to the page we can update the counts using the visibility Api.

And we can have a long interval updates as well which shouldn't create a problem.

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024

I've checked in the code and raised a PR. @rahuldkjain Thanks.

I think there is no need to update the count every 15 seconds. The average usage time per user on the page is 59 seconds.

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024

We can use https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event to refresh the counts. I can help you with a PR. @rahuldkjain

When user clicks the fork button, he will be taken to the github in a new tab, after forking when he returns back to the page we can update the counts using the visibility Api.

And we can have a long interval updates as well which shouldn't create a problem.

Thanks @prakashchokalingam for your efforts.
P.S: Please put a comment to assign the issue before start working.

from github-profile-readme-generator.

prakashchokalingam avatar prakashchokalingam commented on May 21, 2024

Thanks @rahuldkjain

It's just a reference PR @rahuldkjain, It is not created with an intent to merge. will be closing the PR.

from github-profile-readme-generator.

rahuldkjain avatar rahuldkjain commented on May 21, 2024

fixed

from github-profile-readme-generator.

Related Issues (20)

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.