github-api

Editing GIST with cURL

霸气de小男生 提交于 2019-12-11 17:59:48
问题 #!/bin/bash COMMIT=$(git log -1 --pretty=format:'{"subject": "%s", "name": "xxx", "date": "%cD"}') curl -X PATCH -d'{"files": {"latest-commit": {"content": "$COMMIT"}}}' -u user:xxxx https://api.github.com/gists/xxx This just shows $COMMIT in the Gist. I tried playing with ''' and stuff but cannot make this work. Help? Thanks! 回答1: Your $COMMIT variable is not expanded to its value, because it is enclosed in single-quotes. About an actual implementation in Bash The GitHub API require you send

Github API result

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 17:09:08
问题 I use github api to get the details of repository, in the result field, there is "fork" and "has_issue" field, which means whether the project allows to fork and report issue. In my understanding: if the value of "fork" is false, then the value of "forks_count" will be 0, because no one is allowed to fork it; if the value of "has_issue" is false, then "open_issues_count" should be 0. However, https://api.github.com/repos/textmate/textmate both "fork" and "has_issue" are false, but "forks

Get Github total clone statistics

一个人想着一个人 提交于 2019-12-11 10:21:56
问题 Is there a way to get clone statistics of a github repository for any given month? We have a Clones tab with stats for last 14 days https://help.github.com/articles/about-repository-graphs/#traffic but it would be interesting to look at the historical data. 回答1: No. Neither the GitHub UI (https://github.com) nor the GitHub API (https://api.github.com) expose that data currently. 来源: https://stackoverflow.com/questions/30947625/get-github-total-clone-statistics

GitHub OAuth authorize request doesn't redirect to Authorize Application page

雨燕双飞 提交于 2019-12-11 09:30:15
问题 I've implemented my own classes for handling authorization via OAuth to GitHub using Faraday in Ruby. I've verified that under the following conditions: Not logged into GitHub No token exists for the app that a request for authorization via GET to "/login/oauth/authorize" with a random state variable: Redirects to the GitHub login page Redirects to the Authorize Application page after login Executes callback to my app with temporary code after authorizing Responds with access_token when I

Meteor: setup accounts-github not working

牧云@^-^@ 提交于 2019-12-11 08:46:45
问题 I'm trying to setup authentication using github. I followed the documentation. I've installed the packages: $> meteor add accounts-github $> meteor add service-configuration And my code in server/github.js looks like: ServiceConfiguration.configurations.remove({ service: "github" }); ServiceConfiguration.configurations.insert({ service: "github", clientId: '****', secret: '*************' }); Meteor.loginWithGithub({ requestPermissions: ['user', 'public_repo'] }, function (err) { if (err)

Get the metadata for the first N commits in a remote Git repository

馋奶兔 提交于 2019-12-11 07:36:51
问题 Using the following GitHub API it is possible to get the metadata for the commits in a repository, ordered from the latest to the oldest https://api.github.com/repos/git/git/commits Is there a way to obtain similar metadata but in the reverse chronological order of commits, that is, starting with the oldest commits in the repository? NOTE : I want to obtain such metadata without having to download the full repository. Thanks 来源: https://stackoverflow.com/questions/48948949/get-the-metadata

How to create(update) file in GitHub repo using GitHub API and Python requests?

两盒软妹~` 提交于 2019-12-11 07:32:54
问题 I'm creating a new file in GitHub public repo using python. When I try to do this: import json import requests with open('README.md', 'r') as f: content = f.read() payload = {"message": "Add text.txt", "author": {"name": name,"email": email}, "content": content} result = requests.put("https://api.github.com/repos/<GitHubLogin>/<Repo>/contents/README.md", auth=(name, password), json=payload) print(result.json()) I get "{'message': 'content is not valid Base64', ....}" If I try to do this:

Trying to get date specific commit history with curl into raw json text file. Issues with Since, Until, and Pagination?

▼魔方 西西 提交于 2019-12-11 05:29:01
问题 So I am running this in my terminal: curl https://api.github.com/repos/d3/d3/commits?since=2016-07-23T00:00:00Z&until=2017-07-23T23:59:59Z and I think I am getting what I want, however the result is not complete. I think I am just getting the first page. My next move was to back it up to the earliest entry I was able to pull with: curl https://api.github.com/repos/d3/d3/commits?since=2016-07-23T00:00:00Z&until=2017-01-26T21:07:19Z I thought this would give me a separate set of results (and

GitHub V4 GraphQL API with Java using some GraphQL Java library (if available)

*爱你&永不变心* 提交于 2019-12-11 05:23:09
问题 For the V3 Version of the API I found quite a few questions here on Stackoverflow. There are also libraries available at https://developer.github.com/v3/libraries/. I'd rather use the V4 api because I intend to do an integration for the simplegraph open source project see https://github.com/BITPlan/com.bitplan.simplegraph/issues/5 For the V4 API i found the following links so far: https://developer.github.com/v4/explorer/ https://developer.github.com/v4/guides/forming-calls/#the-graphql

Bad request while trying to access Github's v4 API with graphql.js

亡梦爱人 提交于 2019-12-11 04:07:05
问题 I am trying to retrieve some data from Github's GraphQL API using graphql.js library. var graph = graphql("https://api.github.com/graphql", { method: "POST", headers: { "Authorization": "Bearer <my-token-here>", "Content-Type": "application/json" }, fragments: { rateLimitInfo: "on RateLimit {cost,remaining,resetAt}" } }); graph(` query repo($name: String!, $owner: String!){ repository(name:$name, owner:$owner){ id } } `,{ name: "freeCodeCamp", owner: "freeCodeCamp" }).then(function(response){