aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content.rs b/src/content.rs
index 13582f1..b72f4a8 100644
--- a/src/content.rs
+++ b/src/content.rs
@@ -2,6 +2,7 @@ extern crate reqwest;
2extern crate serde_json; 2extern crate serde_json;
3extern crate cursive; 3extern crate cursive;
4extern crate regex; 4extern crate regex;
5extern crate urlencoding;
5 6
6use cursive::theme::Effect; 7use cursive::theme::Effect;
7use cursive::utils::markup::StyledString; 8use cursive::utils::markup::StyledString;
@@ -19,7 +20,7 @@ pub fn query_url_gen(title: &str) -> String {
19 url.push_str("prop=extracts%7Clinks&"); 20 url.push_str("prop=extracts%7Clinks&");
20 url.push_str("indexpageids=1&"); 21 url.push_str("indexpageids=1&");
21 url.push_str("titles="); 22 url.push_str("titles=");
22 url.push_str(title); 23 url.push_str(&urlencoding::encode(title));
23 url.push_str("&"); 24 url.push_str("&");
24 url.push_str("redirects=1&"); 25 url.push_str("redirects=1&");
25 url.push_str("pllimit=40&"); 26 url.push_str("pllimit=40&");
@@ -35,7 +36,7 @@ pub fn search_url_gen(search: &str) -> String {
35 url.push_str("action=opensearch&"); 36 url.push_str("action=opensearch&");
36 url.push_str("format=json&"); 37 url.push_str("format=json&");
37 url.push_str("search="); 38 url.push_str("search=");
38 url.push_str(search); 39 url.push_str(&urlencoding::encode(search));
39 url.push_str("&"); 40 url.push_str("&");
40 url.push_str("limit=20"); 41 url.push_str("limit=20");
41 url 42 url