Comments (24)
@ankurchaudhary627 showing stars count in star this repo button and forks count in fork on github button
from github-profile-readme-generator.
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 I'm having some issues using
useEffect
as I'm not experienced in it. Can I convert thesrc/components/header.js
to a stateful class component and usecomponentDidMount
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.
@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:
There is some css needs to be updated though!
from github-profile-readme-generator.
I've used the buttons before, but removed it to make UI clean. You can go with your approach
from github-profile-readme-generator.
I've checked in the code and raised a PR. @rahuldkjain Thanks.
from github-profile-readme-generator.
Can I work on this?
from github-profile-readme-generator.
Can you please elaborate on this issue? I didn't get this one. @rahuldkjain
from github-profile-readme-generator.
@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.
You can use buttons from https://buttons.github.io/
from github-profile-readme-generator.
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.
@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.
Okay, I will see how I can reduce it, and let you know! @rahuldkjain
from github-profile-readme-generator.
@ankurchaudhary627 any update?
from github-profile-readme-generator.
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.
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.
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.
Isn't the button used there different from this
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.
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.
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.
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.
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.
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.
fixed
from github-profile-readme-generator.
Related Issues (20)
- Add Leetcode stats section HOT 4
- Enhance README Generator with Deno Oak and Fresh Support HOT 1
- Problem with setting up the project HOT 7
- Adding new Data Visualizing tools HOT 1
- scroll-up button (Hacktober Fest) HOT 3
- Problem faced while setting up locally. HOT 1
- Logos not working HOT 4
- social media section not suppoting upper case letters HOT 2
- Tech stack PNG are not loading HOT 3
- [Bug] : Icon was not loading inside static side generation section HOT 4
- Error: error:0308010C:digital envelope routines::unsupported HOT 1
- icons HOT 1
- Error: error:0308010C:digital envelope routines::unsupported HOT 1
- Shell HOT 1
- Add integrated development environments (IDEs) section under skills
- Add apache server for backend section
- Add Odoo as a Python framework HOT 2
- Adding of languages HOT 3
- Add Drupal CMS HOT 1
- Rust Icon not displaying HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github-profile-readme-generator.