aboutsummaryrefslogtreecommitdiff
path: root/src/content.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/content.rs')
-rw-r--r--src/content.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content.rs b/src/content.rs
index 8d025c9..a192446 100644
--- a/src/content.rs
+++ b/src/content.rs
@@ -10,10 +10,11 @@ use cursive::Cursive;
10use cursive::views::Dialog; 10use cursive::views::Dialog;
11use serde_json::Value; 11use serde_json::Value;
12use self::regex::Regex; 12use self::regex::Regex;
13use CONFIGURATION;
13 14
14pub fn query_url_gen(title: &str) -> String { 15pub fn query_url_gen(title: &str) -> String {
15 // query config 16 // query config
16 let mut url = String::from("https://en.wikipedia.org"); 17 let mut url = CONFIGURATION.wiki_url.clone();
17 url.push_str("/w/api.php?"); 18 url.push_str("/w/api.php?");
18 url.push_str("action=query&"); 19 url.push_str("action=query&");
19 url.push_str("format=json&"); 20 url.push_str("format=json&");
@@ -31,7 +32,7 @@ pub fn query_url_gen(title: &str) -> String {
31pub fn search_url_gen(search: &str) -> String { 32pub fn search_url_gen(search: &str) -> String {
32 // search config 33 // search config
33 let search = search.replace(" ", "%20"); 34 let search = search.replace(" ", "%20");
34 let mut url = String::from("https://en.wikipedia.org"); 35 let mut url = CONFIGURATION.wiki_url.clone();
35 url.push_str("/w/api.php?"); 36 url.push_str("/w/api.php?");
36 url.push_str("action=opensearch&"); 37 url.push_str("action=opensearch&");
37 url.push_str("format=json&"); 38 url.push_str("format=json&");