-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] retrieve config.json
profile data from github
#9
Comments
Which data exactly to pull in?
|
config.json
profile data from githubconfig.json
profile data from github
EXAMPLE CODE (to fetch data): |
the v2 code to print all members' json I found that whenever the api of github page can open successfully,the code of v2 can run successfully. example of api of github:https://api.github.com/repos/amliu/profiles |
config.json
profile data from githubconfig.json
profile data from github
So maybe the code needs to add a little check and if the result is
otherwise - great work :-) |
ok~ "caching logic" sounds great~ 👍 |
【local-Storage】message board i am trying to combine this using way of local-storage into the code getAllProfilesFromGithub.js |
@kiecoo Do you have anywhere an example of all the data you will get from Github? I would like to know what fields to add to the profile. So, we will have stuff from config.json and anything else? |
(1) "the code" about what we can get from Github&localStorage) |
[finished] module of get-userprofiles-from-github |
Great! Will try it out tomorrow :) |
So sooner or later somebody shoud put it all together and make a pull request to the wizardamigos profile repository. There is this issue where i wrote some imaginary "demo code" that was meant to demonstrate how the code that combines all this work could look like. |
the link to the github page of module of get-userprofiles-from-github |
Great. I wanted to try but ran again into github api limits. If you want you can try something a bit more challenging :-) Once you deploy this program for free to run on heroku or maybe azure (there is another button in that readme too), you can use it to increase the request limit.
When you confirm all this you will get to a page where you get a ClientID and Client Secret
So what you need on your webpage is actually some kind of var code = window.location.href.match(/\?code=(.*)/)[1]
if (code) {
minixhr(`https://YOUR_GATEKEEPER_HEROKU_URL/authenticate/${code}`, json => {
var data = JSON.parse(json)
console.log(data.token) // This TOKEN is the one you need to make requests to the github api
// so that the user does not have the 60 requests per hour limitation
// NOW START YOUR REAL APP and fetch all your data from github, etc...
})
} else {
// JUST SHOW LOGIN-BUTTON, don't execute all your other code yet
} |
cool, maybe check this comment and try #9 (comment) |
1st part:【open github login page by using client_id】I got stuck because I am not sure about below
could @serapath help to tell me more about how to do the step 2&3 (After searching on Google,I still have no idea how to write code to complete step 2&3 ) because I got stuck ,I searched on google to try more & found something like below (would I write some code like below? if this code is right way for our porject, I still get stuck and have no idea about how to continue the code to make out step 2&3 )
2nd part 【fetch-token by using client_id & client_secret & code】I couldn't understand using-client_id&client_secret&code-to-fetch-token
|
No, because the button doesn't need any input fields, because a new window from github will open which has all the input fields and logic attached :-) ...so it's just a button to open that window
yes
yes, the The code snippet you found is amazing :-) var GITHUB_CLIENT_ID = '19rj28jf2490j0wjeg'
var scopes = ['user', 'repo']
var scope = scopes.join(',')
var githubURL = 'https://github.com/login/oauth/authorize'
var redirect = 'https://kiecoo.github.io/get-userprofiles-from-github/'
var URL = encodeURI(`${githubURL}?client_id=${GITHUB_CLIENT_ID}&scope=${scope}`)
console.log(URL)
This is actually about github API pages, that describes how to put together the very good job 👍 👍 👍 :-) |
� @serapath @ninabreznik because of your detail telling how to code in detail, let me overcome many problems of coding |
i am still looking forward to when we finally put it all together and finish the |
@serapath @ninabreznik
Oauth-code-v1
|
【Button-Oauth】 I meet 2 problems Q1. Button-Oauth( separate-into-html& css) works successfully. I tried to paste all the same code to fit into js then it failed
Q2. should I add final one |
You now need to only replace one thing, the If everything goes right and you can log in, the github page should redirect you to your github page you configured adding Try to make that work first, then we continue. |
so cool XD 【Oauth-button-success】 it could connect to the github page
|
the module of get-userprofiles-from-github ( output ) seems fail to run.I leave the one day not to run get-userprofiles-from-github� . I let it not to exceed the limit but it still couldn't run successfully. I have no idea about how to run it successfully. link: repo of get-userprofiles-from-github |
I am not sure if this-photo-which-I-did is similar with what-you said? |
nice
yes it is the right page, but it also says: So this page: |
yes, that looks good.
yes, we will come there, but let's first finish or fix the github signup so that we dont have the api limit problem anymore :-) ...after that steps, it gets easy again. |
about [ instead configure the github page as a redirect, and not just github.com]I am afraid I got wrong meaning of what you wrote . could you help me to check if the-photo-we-expect-to-be is right? if it's right,I could change it at the night of tomorrow. <no.1>in the photo is according to
<no.2>of photo according to
|
wow, you are really good in documenting all this stuff :-) This address needs to change from You can change that on github where you configured the secret token key stuff for your app. There should be a form |
about [ instead configure the github page as a redirect, and not just github.com]problem: could see this photo-to-show in github |
etag
to check if data updates are availableThe text was updated successfully, but these errors were encountered: