{"id":13605910,"url":"https://github.com/egg-mode-rs/egg-mode","last_synced_at":"2025-12-12T16:38:03.490Z","repository":{"id":38613526,"uuid":"63988585","full_name":"egg-mode-rs/egg-mode","owner":"egg-mode-rs","description":"a twitter api crate for rust","archived":false,"fork":false,"pushed_at":"2023-02-03T01:02:45.000Z","size":1406,"stargazers_count":371,"open_issues_count":19,"forks_count":65,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-16T04:08:43.248Z","etag":null,"topics":["rust","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/egg-mode","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/egg-mode-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["QuietMisdreavus"],"patreon":"QuietMisdreavus","open_collective":null,"ko_fi":"QuietMisdreavus","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-07-22T23:05:43.000Z","updated_at":"2024-09-11T17:05:53.000Z","dependencies_parsed_at":"2023-02-18T02:01:18.704Z","dependency_job_id":null,"html_url":"https://github.com/egg-mode-rs/egg-mode","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egg-mode-rs%2Fegg-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egg-mode-rs%2Fegg-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egg-mode-rs%2Fegg-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egg-mode-rs%2Fegg-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egg-mode-rs","download_url":"https://codeload.github.com/egg-mode-rs/egg-mode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223498101,"owners_count":17155262,"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-08-01T19:01:04.145Z","updated_at":"2025-12-12T16:37:58.433Z","avatar_url":"https://github.com/egg-mode-rs.png","language":"Rust","funding_links":["https://github.com/sponsors/QuietMisdreavus","https://patreon.com/QuietMisdreavus","https://ko-fi.com/QuietMisdreavus"],"categories":["Rust"],"sub_categories":[],"readme":"# abandoned\n\n![status: abandoned](https://img.shields.io/badge/status-abandoned-red)\n\n**NOTE**: This crate is abandoned. See https://github.com/egg-mode-rs/egg-mode/issues/132 for\ndetails.\n\n# egg-mode\n\nTwitter library for Rust ![Build Status](https://github.com/egg-mode-rs/egg-mode/workflows/CI/badge.svg)\n\n[Documentation](https://docs.rs/egg-mode/)\n\nThis is a library for interacting with Twitter from Rust. You can see how much of the Public API is\navailable in the file [TODO.md]. In addition to eventually implementing the entire Public API, an\nexplicit goal for egg-mode is to make it as easy as possible for a client of this library to\ninteract with the Twitter API. Parts of this library are added as a convenience on top of the API\nmechanisms; for example, cursored lists of users and tweets can be used as an iterator in addition\nto being able to manually load a page at a time.\n\n\n[TODO.md]: https://github.com/egg-mode-rs/egg-mode/blob/master/TODO.md\n\n**NOTE**: Previous versions of egg-mode contained a port of twitter-text to use for character\ncounting and mention/hashtag/url extraction. That has since been extracted into its own crate,\n[egg-mode-text].\n\n[egg-mode-text]: https://github.com/egg-mode-rs/egg-mode-text\n\n## MSRV\n\nRust **1.46** or higher\n\n## Usage\n\nAdd the following to your Cargo.toml:\n\n```TOML\n[dependencies]\negg-mode = \"0.16\"\n```\n\nBy default, `egg-mode` uses `native-tls` for encryption, but also supports `rustls`.\nThis may be helpful if you wish to avoid linking against `OpenSSL`.\nTo enable, modify your `Cargo.toml` entry:\n\n```\negg-mode = { version = \"0.16\", features = [\"rustls\"], default-features = false }\n```\n\nIf you also want to avoid using the root certificates on your operating system, the feature\n`rustls_webpki` can be used instead to enable `rustls` and compile the Mozilla root certificates\ninto the final binary, bypassing the operating system's root certificates. To use this feature, put\nthis in your `Cargo.toml` instead:\n\n```\negg-mode = { version = \"0.16\", features = [\"rustls_webpki\"], default-features = false }\n```\n\nSee available methods and tips to get started in the [Documentation](https://docs.rs/egg-mode/).\n\n### Authentication\n\nTo use the twitter API, you must first create an 'application' within twitter's developer portal.\nWe recommened having a browse of the\n[Getting started guide](https://developer.twitter.com/en/docs/twitter-api/getting-started/guide)\nbefore proceeding. Once you have registered your app, you will be given a consumer key and secret\n(also known as API key and secret), which you can use to log in.\n\nTo authenticate a user and request an access token:\n\n```rust\n// NOTE: this assumes you are running inside an `async` function\n\nlet con_token = egg_mode::KeyPair::new(\"consumer key\", \"consumer secret\");\n// \"oob\" is needed for PIN-based auth; see docs for `request_token` for more info\nlet request_token = egg_mode::auth::request_token(\u0026con_token, \"oob\").await.unwrap();\nlet auth_url = egg_mode::auth::authorize_url(\u0026request_token);\n\n// give auth_url to the user, they can sign in to Twitter and accept your app's permissions.\n// they'll receive a PIN in return, they need to give this to your application\n\nlet verifier = \"123456\"; //read the PIN from the user here\n\n// note this consumes con_token; if you want to sign in multiple accounts, clone it here\nlet (token, user_id, screen_name) =\n    egg_mode::auth::access_token(con_token, \u0026request_token, verifier).await.unwrap();\n\n// token can be given to any egg_mode method that asks for a token\n// user_id and screen_name refer to the user who signed in\n```\n\nAs the last line shows, this also returns the User ID and username of the user that authenticated\nwith your application. With this access token, all of the other Twitter functions become available.\n\nWith this token in hand, you can get a user's profile information like this:\n\n```rust\nlet rustlang = egg_mode::user::show(\"rustlang\", \u0026token).await.unwrap();\n\nprintln!(\"{} (@{})\", rustlang.name, rustlang.screen_name);\n```\n\n### Examples\n\nThere are more examples in `examples` folder. To run them you will need to create two files\n`examples/common/consumer_key` and `examples/common/consumer_secret` containing your consumer\nkey and secret respectively.\n\nThe authentication code for most of them is in `examples/common/mod.rs`, though that's also mostly\nwrapped up in code to write the access token to disk and load it back in.\n\n`examples/bearer.rs` is an example of using application-only authentication to get a Bearer token\nand use it to load a user's posts. Other examples showcase a handful of actions from their related\nmodule.\n\nIf you've found egg-mode useful, or just want to communicate your first impressions of it, please\n[track me down on Twitter][qm-twitter] and let me know!\n\n[qm-twitter]: https://twitter.com/QuietMisdreavus\n\n## License\n\nThis library is licensed under the Mozilla Public License, version 2.0. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegg-mode-rs%2Fegg-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegg-mode-rs%2Fegg-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegg-mode-rs%2Fegg-mode/lists"}