From ea11d319304c27c1251fa5abe2c1789028eebb71 Mon Sep 17 00:00:00 2001 From: Serentty <> Date: Sun, 22 Jul 2018 15:09:17 -0400 Subject: Refactor to allow the user to set the language and wiki --- src/content.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/content.rs') 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; use cursive::views::Dialog; use serde_json::Value; use self::regex::Regex; +use CONFIGURATION; pub fn query_url_gen(title: &str) -> String { // query config - let mut url = String::from("https://en.wikipedia.org"); + let mut url = CONFIGURATION.wiki_url.clone(); url.push_str("/w/api.php?"); url.push_str("action=query&"); url.push_str("format=json&"); @@ -31,7 +32,7 @@ pub fn query_url_gen(title: &str) -> String { pub fn search_url_gen(search: &str) -> String { // search config let search = search.replace(" ", "%20"); - let mut url = String::from("https://en.wikipedia.org"); + let mut url = CONFIGURATION.wiki_url.clone(); url.push_str("/w/api.php?"); url.push_str("action=opensearch&"); url.push_str("format=json&"); -- cgit v1.2.3