diff options
author | Akshay <[email protected]> | 2018-07-23 06:26:01 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-07-23 06:26:01 +0100 |
commit | d454b4d574fd6695342a122f26bdbd25966a8f42 (patch) | |
tree | 546e181bb2f7d732371ede20f36cdd4a10d40830 /src/content.rs | |
parent | 0ad9e725683eda9a76b5ba75bbc9a4f4bf7ab29b (diff) | |
parent | ea11d319304c27c1251fa5abe2c1789028eebb71 (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.rs | 5 |
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; | |||
10 | use cursive::views::Dialog; | 10 | use cursive::views::Dialog; |
11 | use serde_json::Value; | 11 | use serde_json::Value; |
12 | use self::regex::Regex; | 12 | use self::regex::Regex; |
13 | use CONFIGURATION; | ||
13 | 14 | ||
14 | pub fn query_url_gen(title: &str) -> String { | 15 | pub 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 { | |||
31 | pub fn search_url_gen(search: &str) -> String { | 32 | pub 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&"); |