Commit to scraper_framework branch

- changing framework from Soup to Scraper
 - removed ncurses library. Will use different library instead.
This commit is contained in:
Daniel Jones 2023-06-28 12:16:04 -05:00
parent a1f2b96b98
commit 65b7e5ecc0
3 changed files with 12 additions and 14 deletions

View File

@ -8,4 +8,5 @@ edition = "2021"
[dependencies] [dependencies]
epub = "1.2.2" epub = "1.2.2"
ncurses = "5.101.0" ncurses = "5.101.0"
soup = "0.5.1" scraper = "0.17.1"

View File

@ -4,20 +4,17 @@ Language: Rustc 1.69.0
ide: CLion ide: CLion
Operating system: Fedora 38/WSL Operating system: Fedora 38/WSL
Purpose: This class is meant to process and return HTML formatted text as strings. Purpose: This class is meant to process and return HTML formatted text as strings.
Last edited: 5/20/23 Last edited: 6/28/23
*/ */
//TODO: I received a warning that soup is going to be incompatible in a future version, as it uses an old version of html5ever.
/*Possible solutions: use scraper::{Html, Selector};
- Convert to html5ever
- find alternative library/framework
- convert html module to python script, use python version of soup
- convert html by hand(absolutely not)
*/
use soup::{Soup};
pub fn main(content: String) -> String { pub fn main(content: String) -> String {
let str_content = content; let str_content = content;
let soup = Soup::new(&str_content);
let page = soup.text(); println!("{}", str_content);
let page = str_content;
return page; return page;
} }

View File

@ -9,7 +9,7 @@ Last edited: 5/19/23
mod html_module; mod html_module;
mod ncurses_module;
use epub::doc::EpubDoc; //library for navigating epubs use epub::doc::EpubDoc; //library for navigating epubs
use std::env; use std::env;
@ -25,7 +25,7 @@ fn main() {
else { else {
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
let filename = &args[1]; let filename = &args[1];
ncurses_module::main();
epub_func(filename); epub_func(filename);
} }
} }