{"id":21577767,"url":"https://github.com/plh97/github-report","last_synced_at":"2025-04-10T17:29:07.593Z","repository":{"id":57135773,"uuid":"123759853","full_name":"plh97/github-report","owner":"plh97","description":"☕Automatic generation of github reports with React","archived":false,"fork":false,"pushed_at":"2023-12-20T02:35:55.000Z","size":3787,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T11:10:48.706Z","etag":null,"topics":["githubrepoapi","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plh97.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-04T05:27:02.000Z","updated_at":"2023-10-23T02:45:50.000Z","dependencies_parsed_at":"2024-06-21T15:34:12.397Z","dependency_job_id":"b159b642-4bf2-46c1-b40d-7f5121fe17cc","html_url":"https://github.com/plh97/github-report","commit_stats":null,"previous_names":["pengliheng/github-report"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plh97%2Fgithub-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plh97%2Fgithub-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plh97%2Fgithub-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plh97%2Fgithub-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plh97","download_url":"https://codeload.github.com/plh97/github-report/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261983,"owners_count":21074229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["githubrepoapi","react"],"created_at":"2024-11-24T13:08:31.017Z","updated_at":"2025-04-10T17:29:07.552Z","avatar_url":"https://github.com/plh97.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![author](https://img.shields.io/badge/author-peng-blue.svg)](https://www.pipk.top)\n[![Node.js Version](https://img.shields.io/badge/node.js-9.2.0-blue.svg)](http://nodejs.org/download)\n\n### to generate a GitHub report\n\n### [example](https://chat.pipk.top/githubReport/pengliheng)\n\n```js\nurl = 'https://chat.pipk.top/githubReport/\u003cuserName\u003e';\n```\n![](https://static.pipk.top/api/public/images/8536904566607304.png)\n\u003c!-- ## 1.you need to have an router `/graphql`,and i will post request to github url `https://api.github.com/graphql`, so please paste the below code to your router(`/graphql`) config,if you wana to use.\n\n```js\nconst axios = require(\"axios\");\nexports.getCode = async ctx =\u003e {\n  const query = ctx.request.body;\n  const queryFunc = async data =\u003e\n    new Promise((resolve, reject) =\u003e {\n      axios({\n        url: \"https://api.github.com/graphql\",\n        method: \"post\",\n        headers: {\n          Authorization: `bearer ${process.env.access_token}`,\n          \"Content-Type\": \"application/json\"\n        },\n        data\n      })\n        .then(res =\u003e resolve(res.data))\n        .catch(err =\u003e reject(err));\n    });\n  ctx.body = await queryFunc(query);\n}; --\u003e\n\u003c!-- ``` --\u003e\n\n\u003c!-- ## 2.generate an [github access_token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)\n\n* #### pay attention to avoid below thing!dont put your access token into headers,because github may think it an dangerout behave thing, and they will cancel your token immediately.\n\n```js\naxios({\n  url: \"https://api.github.com/graphql\",\n  method: \"post\",\n  headers: {\n    Authorization: `bearer \u003cyour token\u003e`,\n    \"Content-Type\": \"application/json\"\n  },\n  data\n})\n  .then(res =\u003e resolve(res.data))\n  .catch(err =\u003e reject(err));\n```\n\n![](https://cdn.suisuijiang.com/message_1520156894273.png) --\u003e\n\n\u003c!-- ## 3.to set environment variable\n\n```js\n// nodejs\n// nodemon =\u003e create file =\u003e nodemonrc.json\n{\n  \"verbose\": true,\n  \"env\": {\n    \"access_token\": \"your personal token\",\n    \"NODE_ENV\": \"dev\"\n  }\n}\n\n// pm2 =\u003e create file =\u003e ecosystem.config.js\nmodule.exports = {\n  apps: [\n    {\n      name: \"blog\",\n      script: \"./src/server/index.js\",\n      watch: true,\n      env: {\n        \"PORT\": 80,\n        \"NODE_ENV\": \"dev\",\n        \"access_token\": \"your personal token\",\n      },\n      env_prod: {\n        \"PORT\": 8001,\n        \"NODE_ENV\": \"prod\",\n        \"access_token\": \"your personal token\",\n      }\n    }\n  ]\n} --\u003e\n\n\u003c!-- // centos/linux\n// set access_token=yourToken\n// export access_token=yourToken\n// not sure just google/baidu\n``` --\u003e\n\n### 1.just use it as your react component\n\n\u003c!-- ```jsx\n// package\nimport React, { Component } from \"react\";\nimport Github from \"@pengliheng/github-report\";\nimport '@pengliheng/github-report/lib/index.less';\n\nclass Root extends Component {\n  render() {\n    return (\n      \u003cdiv className=\"github\"\u003e\n        \u003cGithub name=\"yinxin630\"/\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nrender(\n  \u003cRoot /\u003e,\n  document.getElementById('root'),\n);\n``` --\u003e\n\n### you can input it while your router change\n```jsx\nconst GithubReport = props =\u003e (\n  \u003cdiv className=\"github-report\"\u003e\n    \u003cGithub {...props} /\u003e\n  \u003c/div\u003e\n);\n\n// router \n\u003cRoute path=\"/githubReport/:name\" component={GithubReport} /\u003e\n\n```\n\n\u003c!-- ```js\naxios({\n  url: 'https://chat.pipk.top/graphql',\n  method: 'post',\n  // url: `https://api.github.com/graphql`,\n  // method: 'post',\n  // headers: {\n  //   'Authorization': `bearer ${process.env.access_token}`,\n  //   'Content-Type': 'application/json'\n  // },\n  data: {\n    query: `{\n      search(query: \"${args.name||'pengliheng'}\", type: USER, first: 1) {    \n        edges {\n          node {\n            ... on User {\n              avatarUrl login bio url createdAt\n              contributedRepositories(first: 100,orderBy: {field: CREATED_AT, direction: DESC}) {\n                totalCount\n                nodes{\n                  nameWithOwner url\n                }\n              }\n              starredRepositories(first:100) {\n                nodes {\n                  primaryLanguage {\n                    name color\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }`,\n  },\n}).then(res =\u003e resolve(res.data.data))\n  .catch(err =\u003e reject(err))\n})\n``` --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplh97%2Fgithub-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplh97%2Fgithub-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplh97%2Fgithub-report/lists"}