github-api

Searching for a repo in Github APIv3

半城伤御伤魂 提交于 2019-12-24 15:42:55
问题 I know how to search for a repository by providing key words in Github APIv2 .But is this possible in the APIv3? http://develop.github.com/p/repo.html It says "This API is deprecated. Check out API v3 for the latest documentation." But I would like to do the same search operation in APIv3. Is this possible? Please help..... 回答1: Repository search is now currently supported using API v3. The documentation is available here. 来源: https://stackoverflow.com/questions/9310657/searching-for-a-repo

Github JSON API Blob Binary data as Base64 encoded strings

跟風遠走 提交于 2019-12-24 11:35:07
问题 When I make this request to the Github API curl -H "Accept: application/vnd.github.v3.raw" \ https://api.github.com/repos/STRd6/SurfN-2-Sur5/git/blobs/cf0167baab25ea841834fee66167ca33af28a7bf I receive: 鐎G IHDR ٳ⿀bKGD̿ pHYsHHFɫ> vpAg 纜퀀剄ATHǭきఈEaᙜ扊ᦒă彾 4Gᦇ߸�SDԱSЍ:詎⮢⍯5Ɏ搩Ta2ك2xқ?⳷ṵࡓ瑛躒ቬ쐼뀛է鑳ԷWꇎsો:F坠ꀣ%tEXtdate:create2011-08-20T14:56:12-07:00ራ뀀%tEXtdate:modify2011-08-20T14:56:12-07:00ՓIEND  When I expect to receive something more like: �PNG IHDR szz�IDATXGU�Y���������c����.aQ$�(��<E�1��? I

GitHub API AJAX POST returning 422

隐身守侯 提交于 2019-12-24 05:45:58
问题 I'm trying to post an issue via the GitHub API and keep getting a 422 error. I've tried various approaches over the past few days with no luck - I'm hoping this is a simple mistake that someone can spot quickly? My call is below - I'm using my Personal Access Token for authorization. $.ajax({ type: "POST", url: `https://api.github.com/repos/MYUSERNAME/MYREPONAME/issues?access_token=MYACCESSTOKEN`, contentType: "application/json", dataType: "json", data: JSON.stringify({ "title": "Found a bug"

How to update a pull request through Github API

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 05:33:31
问题 I want to update the title of a pull request and performing the below to achieve it :- (followed this doc https://developer.github.com/v3/pulls/#update-a-pull-request) data = {"title": "New title"} url='https://hostname/api/v3/repos/owner/repo/pulls/80' token = 'my-token' headers = {'Content-type': 'application/json', 'Accept': 'application/json', 'Authorization': 'token %s' % token} resp = requests.patch(url, data=json.dumps(data), headers=headers) print resp.json() What am I missing ?

How to update a pull request through Github API

对着背影说爱祢 提交于 2019-12-24 05:33:02
问题 I want to update the title of a pull request and performing the below to achieve it :- (followed this doc https://developer.github.com/v3/pulls/#update-a-pull-request) data = {"title": "New title"} url='https://hostname/api/v3/repos/owner/repo/pulls/80' token = 'my-token' headers = {'Content-type': 'application/json', 'Accept': 'application/json', 'Authorization': 'token %s' % token} resp = requests.patch(url, data=json.dumps(data), headers=headers) print resp.json() What am I missing ?

How to get github issues(tickets) from terminal?

折月煮酒 提交于 2019-12-24 05:18:05
问题 There is a way to get all the issues from a git repository? I need to populate a mysql database with the issues of a specific project with the issues status, reporter, priority, etc... Thanks! 回答1: Git and GitHub are two different things. The former is a version control system which does not know anything about “issues” or “tickets”, while the latter is a project platform with source hosting and issue management. So the GitHub issues are very specific to GitHub. No Git command will be able to

Authentication for GitHub API v4 with Apollo-Client

断了今生、忘了曾经 提交于 2019-12-23 23:37:16
问题 GitHub's new GraphQL API requires authentication with a token as the previous version. So, how do we add a 'Header' information into the HttpLink inside Apollo-Client ? const client = new ApolloClient({ link: new HttpLink({ uri: 'https://api.github.com/graphql' }), cache: new InMemoryCache() }); 回答1: You can define authorization header using apollo-link-context , check the header section A complete example for using apollo-client for Github API would be : import { ApolloClient } from 'apollo

Github API(v3): Sort search result by date created

家住魔仙堡 提交于 2019-12-23 21:20:35
问题 I want to sort my repositories search result by the date they are created. This might be an easy task but I have been struggling for a while. Please help :( 回答1: If Github API Graphql v4 is still an option, you can do this very easily, from the explorer : { user(login: "bertrandmartel") { repositories(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) { nodes { createdAt name } } } } using curl : curl -H "Authorization: bearer token" -d ' { "query": "query { user(login: \

Checking if a user made a commit to Github using API on a given day

旧城冷巷雨未停 提交于 2019-12-23 18:01:37
问题 I am trying to build an app to track GitHub "Streaks" (How many days in a row a user has committed to GitHub.) I'm trying to use the GitHub API to do this, but I can't figure out where. If I can't pull back the streak, if I could find a way to see if they had committed on a given day (like yesterday) I could recursively determine the streak by continuing to check the previous day until there wasn't a commit. I can find details about a specific commit https://developer.github.com/v3/repos

Gist / Github API - get private and public Gists

霸气de小男生 提交于 2019-12-23 17:26:03
问题 I am trying to list all gist from a group of users using the github api. This is working really well but I can't seem to get it to return private gists for myself or any others users. I know that you can set scope in the request but I don't get how I would set this in my JQuery request and what scope should I use to get private gists? Some of my code is below: var the_url = 'https://api.github.com/users/'+ encodeURIComponent(user) +'/gists'; $.oauth ({ consumerKey: 'xxxxxxxxxxxxxxxxx',