salarkhan / git-pear

swap credentials after each commit
3 stars 0 forks source link

get-name via GitHub API #59

Open salarkhan opened 10 years ago

salarkhan commented 10 years ago

Fixes #58

salarkhan commented 10 years ago

Just submitted the PR so we can tag team this sucka.

I'm assuming in the code I gotta do something like the following for the optional API key idea

if [ $SGU_API_KEY ]; then
    local json=`curl -H "Authorization: token $SGU_API_KEY" -s https://api.github.com/users/$username`
  else
    local json=`curl -s https://api.github.com/users/$username`
  fi

i haven't done OAuth is a goddamn millenia, so I'm just gonna leave this here for when it isn't 3 in the morn --------> github oath ish

salarkhan commented 10 years ago

@supertopher 4 API calls. jesus.

thinking we store the full names in the git config?

salarkhan commented 10 years ago

screen shot 2014-09-11 at 8 12 44 pm progress doe!

salarkhan commented 10 years ago

@supertopher it is done. what a song

salarkhan commented 10 years ago

need to DRY the json parsing up, but im down to put that aside till after brew install works

salarkhan commented 10 years ago

@supertopher lemme know if you wanna do homebrew. maybe we can get @Souldjinn on this ish

supertopher commented 10 years ago

the error message for failing to get a username says update your email address not update your user name

salarkhan commented 10 years ago

That's because we need their email address to retrieve their username. And then we make a second call to get their full name using that username

supertopher commented 10 years ago

i've tested this locally twice unless i'm fucking up some spelling i am not getting name resolution.

this is my solo screen shot 2014-09-20 at 11 10 44 am

and maybe we could tell the user which email address it is failing on? screen shot 2014-09-20 at 11 11 41 am

supertopher commented 10 years ago

This may be an outlier but i'm not pulling a name solo (note some old cruft in the config, though i don't think it is causing errors) screen shot 2014-09-23 at 2 46 32 pm

salarkhan commented 9 years ago

confused...cause that's not happening to me: screen shot 2014-10-04 at 12 59 26 am screen shot 2014-10-04 at 12 59 18 am

salarkhan commented 9 years ago

how the shit do you resize your images?!