aboutsummaryrefslogtreecommitdiff
path: root/src/content.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2018-07-23 06:26:01 +0100
committerGitHub <[email protected]>2018-07-23 06:26:01 +0100
commitd454b4d574fd6695342a122f26bdbd25966a8f42 (patch)
tree546e181bb2f7d732371ede20f36cdd4a10d40830 /src/content.rs
parent0ad9e725683eda9a76b5ba75bbc9a4f4bf7ab29b (diff)
parentea11d319304c27c1251fa5abe2c1789028eebb71 (diff)
Merge pull request #4 from Serentty/arguments
Refactor to allow the user to set the language and wiki
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&");