ADXMUSFXOKBPCHW4XS3T4KLWMPGQPYDMZW6YFFSHZPAQKEGIKCBQC
2CKX4R6ONNXDXGRYZ5NZEBJZFX5Z6BYPGNJ7LMXUHHFB4MUFJRCAC
UIMZBURR7KOWSREO4GDH5C2LZDUTEZBKQNYWBYSFGUTRYJ4GKSNQC
5GQNHICLSFAA7ZUFXUCNACCPAIIGK4DV2QPTONDNXLS4TJJTOFHAC
5JMYBRF3UYX4LFH7JK6S4BEDKRVKDFIL4YKTCWKMKP4TMNNGQFKQC
BSPWOOHZMN3RAOHGJ2A3XKUOUCFFAOXS7YR67E3AARPPPIA5YPDAC
XIHPYOWDLQY2MVMVUQPH23O3TBALRG4G2CHSLWSCAYMY5NVJ32WQC
MQKOX2CQ7AON24UJC7RORAC7Y2UROROVG7BBKLVWURPXKY75JV5AC
ZD3G3BCXBEXELHH3KMXMDUQUJ4BXIF4ZSZKFIJJCRO7IDK4XPOWAC
76TBVFPIFU3LSMXY5NAHZBH6HRJLSLK43PGOPL6QQ2YYVBJ64QAQC
THSENT35O3PIXQ343QPPE3DJGR4YVULN6YPS5ETW5PXSVGZZQIZAC
EEJ6CBJRTXLPQP44I2RLWVLJBX565DXXAWU4JIWNA3MMNE7WB5LQC
let mut state = State::new().expect(
".subscription file couldn't be parsed...I probably changed the format...sorry",
);
if let Err(err) = create_directories() {
eprintln!("{}", err);
return;
}
let mut state = match State::new() {
Ok(val) => val,
Err(err) => {
eprintln!("{}", err);
return;
}
};
File::open(&path).unwrap().read_to_string(&mut s).unwrap();
match serde_json::from_str(&s) {
Ok(val) => {
let mut state: State = val;
// Check if a day has passed (86400 seconds)
if state
.last_run_time
.signed_duration_since(Utc::now())
.num_seconds() < -86400
{
update_rss(&mut state);
}
state.last_run_time = Utc::now();
Ok(state)
let mut file = match File::open(&path) {
Ok(val) => val,
Err(err) => return Err(format!("{}", err)),
};
if let Err(err) = file.read_to_string(&mut s) {
return Err(format!("{}", err));
};
let mut state: State = match serde_json::from_str(&s) {
Ok(val) => val,
Err(err) => {
return Err(format!(
"Could not parse: {}\nReason: {}",
&path.to_str().unwrap(),
err
))
Err(_) => Err(format!(
"Failed to parse .subscriptions ... I probably changed the schema ... sorry"
)),
};
// Check if a day has passed (86400 seconds)
if state
.last_run_time
.signed_duration_since(Utc::now())
.num_seconds() < -86400
{
update_rss(&mut state);