{"id":13483932,"url":"https://github.com/felipeelias/crystal-github","last_synced_at":"2025-03-27T15:30:39.903Z","repository":{"id":136329379,"uuid":"81663131","full_name":"felipeelias/crystal-github","owner":"felipeelias","description":"Github API wrapper in Crystal! (work in progress)","archived":true,"fork":false,"pushed_at":"2017-06-08T20:28:16.000Z","size":16,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T17:48:24.334Z","etag":null,"topics":["api","crystal","github"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felipeelias.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-02-11T15:52:25.000Z","updated_at":"2023-01-28T12:51:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfe3d40c-37c8-4524-8145-c3d23849b0fa","html_url":"https://github.com/felipeelias/crystal-github","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeelias%2Fcrystal-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeelias%2Fcrystal-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeelias%2Fcrystal-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeelias%2Fcrystal-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipeelias","download_url":"https://codeload.github.com/felipeelias/crystal-github/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245871690,"owners_count":20686248,"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":["api","crystal","github"],"created_at":"2024-07-31T17:01:16.996Z","updated_at":"2025-03-27T15:30:39.487Z","avatar_url":"https://github.com/felipeelias.png","language":"Crystal","readme":"# crystal-github\n\n[![Build Status](https://travis-ci.org/felipeelias/crystal-github.svg?branch=master)](https://travis-ci.org/felipeelias/crystal-github)\n\nGithub API wrapper in [Crystal](https://crystal-lang.org)! (work in progress)\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  github:\n    github: felipeelias/crystal-github\n    version: ~\u003e 0.1.0\n```\n\n## Usage\n\nOn your application code, require it with:\n\n```crystal\nrequire \"github\"\n```\n\n### OAuth2 Flow\n\nFor now, this client only supports OAuth2 flow to make requests to Github API. To get this working, you need to register a new [`application`](https://github.com/settings/applications/new) and setup the proper attributes.\n\n```crystal\noauth2 = Github::OAuth2.new(client_id, client_secret, redirect_uri)\n```\n\nWith that, you can build the `authorization_uri` and redirect your users to that\n\n```crystal\noauth2.authorize_uri\n# =\u003e https://github.com/login/oauth/authorize...\n```\n\nIf the user authorizes your application, you should be redirected back to the `redirect_uri` that you set up previously, with a `code` parameter in the URI\n\n```crystal\n# if you're using kemal\ncode = env.params.query[\"code\"]\n\ntoken = oauth2.access_token(code)\n# =\u003e OAuth2::AccessToken is returned\n\ntoken.access_token\n# =\u003e \"53gdf31mnv...\"\n```\n\nYou can then use the `access_token` to authorize users with other API requests.\n\n### Users API\n\n**NOTE: subject to change**\n\n```crystal\napi = Github::UserApi.new(token.access_token)\nuser = api.user\n# =\u003e {\"login\" =\u003e ..., \"avatar_url\" =\u003e ...}\n```\n\n## Development\n\nRun tests with:\n\n    crystal spec\n\nYou can test it locally with other apps by adding it to your `shards.yml`\n\n```yaml\ndependencies:\n  github:\n    path: path/to/crystal-github\n```\n\n## Contributing\n\n1. Create an issue on Github **first**, describing the feature or fix you'd like to add.\n2. If nobody is working on the issue, feel free to fork and send a pull-request\n\n## Contributors\n\n- [felipeelias](https://github.com/felipeelias) Felipe Philipp - creator, maintainer\n","funding_links":[],"categories":["Third-party APIs"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeelias%2Fcrystal-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipeelias%2Fcrystal-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeelias%2Fcrystal-github/lists"}