{"id":16039754,"url":"https://github.com/hpprc/kuon","last_synced_at":"2025-03-16T07:32:29.795Z","repository":{"id":52168026,"uuid":"267562609","full_name":"hppRC/kuon","owner":"hppRC","description":":bird: [WIP] Twitter Client Library written in Rust :crab:","archived":false,"fork":false,"pushed_at":"2021-05-06T16:04:57.000Z","size":200,"stargazers_count":49,"open_issues_count":6,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-27T05:51:10.457Z","etag":null,"topics":["rust","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/kuon","language":"Rust","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/hppRC.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}},"created_at":"2020-05-28T10:40:03.000Z","updated_at":"2024-02-12T15:22:34.000Z","dependencies_parsed_at":"2022-09-05T01:50:25.645Z","dependency_job_id":null,"html_url":"https://github.com/hppRC/kuon","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hppRC%2Fkuon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hppRC%2Fkuon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hppRC%2Fkuon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hppRC%2Fkuon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hppRC","download_url":"https://codeload.github.com/hppRC/kuon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806050,"owners_count":20350775,"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":["rust","twitter","twitter-api"],"created_at":"2024-10-08T23:07:31.627Z","updated_at":"2025-03-16T07:32:29.450Z","avatar_url":"https://github.com/hppRC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![kuon](.github/images/kuon.png)\n\n# Kuon\n\nTwitter Client Library written in Rust.\n\ninspired by [anaconda](https://github.com/ChimeraCoder/anaconda)\n\n## Example\n\n```rust\nlet builder = kuon::TwitterAPI::builder()\n    .access_token(\"access_token\")\n    .access_token_secret(\"access_token_secret\")\n    .api_key(\"api_key\")\n    .api_secret_key(\"api_secret_key\");\n\nlet api = builder.build().await?;\n\nlet res = api.search_tweets().q(\"rust\").send().await?;\nlet res = api.favorite().id(0).send().await?;\nlet res = api.retweet().id(0).send().await?;\n```\n\n### Shord-hand\n\n```rust\n// Please set API_KEY, API_SECRET_KEY, ACCESS_TOKEN, ACCESS_TOKEN_SECRET in your environment\nlet api = kuon::TwitterAPI::new_using_env().await?;\n\nlet res = api.search_tweets().q(\"rust\").send().await?;\nfor tweet in res.statuses {\n    println!(\"{}\", tweet.text);\n}\n```\n\n\n## Advanced Type-safe Usage\n\n```rust\nuse anyhow::Result;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    // Please set API_KEY, API_SECRET_KEY, ACCESS_TOKEN, ACCESS_TOKEN_SECRET in environment\n    let api: kuon::TwitterAPI = kuon::TwitterAPI::new_using_env().await?;\n    let res = api\n        .search_tweets()\n        .q(\"rust\")\n        // .geocode(\"geocode\")\n        // .lang(\"lang\")\n        // .locale(\"locale\")\n        // .result_type(\"result_type\")\n        // .count(100)\n        // .until(\"2000-01-01\")\n        // .since_id(0)\n        // .max_id(100000000)\n        // .include_entities(true)\n        .send()\n        .await;\n\n    match res {\n        Ok(search_result) =\u003e {\n            for tweet in search_result.statuses {\n                println!(\"{}\", tweet.text);\n            }\n        }\n        Err(kuon::Error::TwitterAPIError(e, param_str)) =\u003e {\n            // You can confirm a error originated from Twitter API.\n            println!(\"{}\", param_str);\n            assert!(e.errors.len() \u003e 0)\n        }\n        Err(kuon::Error::HTTPRequestError(e)) =\u003e {\n            println!(\"{}\", e);\n            // Do something!\n        }\n        _ =\u003e panic!(\"Unexpected error!\"),\n    }\n\n    Ok(())\n}\n```\n\nSee more details for `/examples`.\n\n\nThis crate is named after Japanese Virtual YouTuber [Chitose Kudou](https://www.youtube.com/channel/UCP2o-o6u4uX3uq1hXspl0rg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpprc%2Fkuon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpprc%2Fkuon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpprc%2Fkuon/lists"}