groupme-rust-stats 1.0.7

A rust command line tool which downloads the complete history of a groupme chat group. It also runs a few analytics on the data and displays as a plain text file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use config;
use std::fs::File;
use std::io::Write;


pub fn save_as_text(results: Vec<Vec<String>>){
	let mut settings = config::Config::default();
    settings
		.merge(config::File::with_name("Settings")).unwrap()
		.merge(config::Environment::with_prefix("APP")).unwrap();

	let filename =  settings.get_str("results_folder").unwrap_or_default() + "/results.txt";

    let mut f = File::create(filename).expect("Unable to open file");
    for cur_user in results {
        cur_user.iter().for_each(|res_line| f.write_all(res_line.as_bytes()).expect("Unable to write data"));
    }
}