aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 1573cdb6501d0cdc8e3f5cd6da3a6e8a139c0fef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
extern crate reqwest;
extern crate serde_json;

use serde_json::Value;

pub mod content;

fn main() {
    let url = format!("https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&list=&meta=&indexpageids=1&continue=%7C%7Cimageinfo&titles={}&exlimit=20&explaintext=1&exsectionformat=plain", title);
    let res = reqwest::get(&url);

    match res {
        Ok(res) => {
            if res.status().is_success() {
                content::get_extract("")
            }
        }

        Err(_) {
            panic!("Oh no!");
        }
    }
}