Skip to content

Commit

Permalink
linux build guide + usage track
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidBrot committed Jan 5, 2020
1 parent 730404e commit 3cefa17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ thread 'main' panicked at 'WTF in main! Perhaps the credentials or the endpoint

Not relevant to the average user.

If you want to clone this repository and build the executable yourself, you might need to install the dependencies for [winres](https://github.com/mxre/winres).
If you want to clone this repository and build the executable yourself for windows, you might need to install the dependencies for [winres](https://github.com/mxre/winres).

If you are compiling on ubuntu, you need `openssl-dev` and `pkg-config`. Both are available in apt-get. On debian, `openssl-dev` is called differently.

Note that this repository is **currently not licensed to you**. The source code belongs to me, but I do hereby grant you explicit permission to use the executables.
7 changes: 7 additions & 0 deletions dbparse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const CONFIG_YAML_FILLABLE_TEMPLATE: &str = r###"db_conf:
"###;

const SIGNIN_POST_URL: &str = "https://db.cevi.ch/users/sign_in.json";
const USAGE_TRACKING_URL: &str = "https://eric.mink.li/src/php/ccount/click.php?id=cevi_versand_usage";

pub enum Verbosity {
No,
Expand All @@ -81,6 +82,7 @@ pub struct MainReturns {
pub fn run(user_interface: &dyn DbparseInteractor) -> Result<MainReturns, Box<dyn Error>> {
// load database API token
let config = setup_config(user_interface);
let _failure = track_usage();
let dataset: ReasonableDataset = get_data_for_versand(&config).expect("WTF in main! Perhaps the credentials or the endpoint url are invalid?");
user_interface.on_download_finished();
return run_with_reasonable_dataset(dataset);
Expand Down Expand Up @@ -285,6 +287,11 @@ fn get_data_for_versand(
return Ok(reasonable_dataset);
}

fn track_usage() -> Result<(), Box<dyn std::error::Error>> {
let _body = chttp::get(USAGE_TRACKING_URL)?.into_body().text()?;
Ok(())
}

fn reasonablify_body(body: &String) -> Result<ReasonableDataset, Box<dyn std::error::Error>> {
// deserialize the json data into a struct
let dese: PeopleRequest = serde_json::from_str::<PeopleRequest>(body.as_ref())?;
Expand Down

0 comments on commit 3cefa17

Please sign in to comment.