Created
December 1, 2015 16:18
-
-
Save alicemaz/4ec9818acc1c9f367773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut opts = HashMap::new(); | |
opts.insert("screen_name", "someone"); | |
let opts = opts; | |
let json = twitter.get("users/show", &opts); | |
println!("{}", json.pretty()); | |
let obj = json.as_object().unwrap(); | |
let sn = obj.get("screen_name").unwrap().as_string().unwrap(); | |
let txt = obj.get("status").unwrap().as_object().unwrap().get("text").unwrap().as_string().unwrap(); | |
// => "@someone: some cool tweet" | |
println!("@{}: {}", sn, txt); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment