{"id":21423859,"url":"https://github.com/0xd3adcode/metronapi","last_synced_at":"2025-03-16T20:41:07.585Z","repository":{"id":154319229,"uuid":"584515155","full_name":"0xD3ADCODE/MetronAPI","owner":"0xD3ADCODE","description":"Kotlin library for working with Metron API. Powered by OkHttp, Retrofit, Gson and RxJava","archived":false,"fork":false,"pushed_at":"2023-07-23T14:47:52.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T07:12:59.311Z","etag":null,"topics":["api","gson","kotlin","library","metron","okhttp","retrofit2","rxjava2"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/0xD3ADCODE.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-02T19:38:28.000Z","updated_at":"2023-08-25T19:38:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba0cf78b-71d5-415d-a40d-33025b11374e","html_url":"https://github.com/0xD3ADCODE/MetronAPI","commit_stats":null,"previous_names":["0xd3adcode/metronapi","atsumerudev/metronapi"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xD3ADCODE%2FMetronAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xD3ADCODE%2FMetronAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xD3ADCODE%2FMetronAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xD3ADCODE%2FMetronAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xD3ADCODE","download_url":"https://codeload.github.com/0xD3ADCODE/MetronAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933373,"owners_count":20370988,"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","gson","kotlin","library","metron","okhttp","retrofit2","rxjava2"],"created_at":"2024-11-22T21:18:32.003Z","updated_at":"2025-03-16T20:41:07.567Z","avatar_url":"https://github.com/0xD3ADCODE.png","language":"Kotlin","readme":"# MetronAPI\n\nKotlin library for working with [Metron API](https://metron.cloud). Powered by [OkHttp](https://square.github.io/okhttp/), [Retrofit](https://square.github.io/retrofit/), [Gson](https://github.com/google/gson) and [RxJava](https://github.com/ReactiveX/RxJava)\n\n## Dependency\n\nTo add this library as dependency, add this line into your `dependencies` build.gradle block:\n```groovy\nimplementation 'com.github.AtsumeruDev:MetronAPI:-SNAPSHOT'\n```\n\nAlso, make sure to add this repository into `repositories` block:\n```groovy\nmaven { url 'https://jitpack.io' }\n```\n\n## Usage\n\n### Initializing\nUsage of library is very simple. First, initialize it (make sure to do it as soon as possible before making any Metron requests):\n```kotlin\nMetronApi.init(\n    builder: OkHttpClient.Builder = OkHttpClient.Builder(), // Custom OkHttp client Builder\n    userName: String, // Your Metron account username\n    password: String, // Your Metron account password\n    apiEndpoint: String = \"https://metron.cloud/api/\", // API Endpoint url. Always try to use default one\n    userAgent: String = \"MetronAPI Library\", // API UserAgent. Set your app's name or use default one\n    httpConnectTimeoutMs: Long = 15000, // Connection timeout in milliseconds\n    httpReadTimeoutMs: Long = 25000, // Read timeout in milliseconds\n    isDebug: Boolean = false // Debug mode or not. When true, library will log every request into logs \n)\n```\n\nSimple initializing method with defaults:\n```kotlin\nMetronApi.init(userName = {username}, password = {password})\n```\n\n### API Methods calling\n\nAfter that, you can make calls to any of defined methods. For example, getting info about [Suicide Squad (2016)](https://metron.cloud/series/suicide-squad-2016/) serie (with id `3006`):\n\n#### Async RXJava way:\n```java\nMetronApi.getSerie(3006)\n    .cache()\n    .subscribeOn(Schedulers.newThread())\n    .observeOn(Schedulers.io())\n    .subscribe(\n        serie -\u003e {do on success},\n        throwable -\u003e {do on throwable}\n);\n```\n\n#### Blocking way:\n```java\nMetronApi.getSerie(3006).blockingGet()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xd3adcode%2Fmetronapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xd3adcode%2Fmetronapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xd3adcode%2Fmetronapi/lists"}