From 83a8f2873caa11c0151a43099abee08341f02ccf Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Wed, 24 Apr 2024 11:07:31 +0200 Subject: Update for 8th semestr :) --- src/yasa/core.clj | 17 +++++++++++------ src/yasa/settings.clj | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/yasa/core.clj b/src/yasa/core.clj index 668197e..d665181 100644 --- a/src/yasa/core.clj +++ b/src/yasa/core.clj @@ -10,8 +10,8 @@ :cocpit "https://liceum-internetowe.edu.pl/my/"}) (def lessons - {:polski "https://liceum-internetowe.edu.pl/course/view.php?id=163" - :matematyka "https://liceum-internetowe.edu.pl/course/view.php?id=171" + {:polski "https://liceum-internetowe.edu.pl/course/view.php?id=244" + :matematyka "https://liceum-internetowe.edu.pl/course/view.php?id=177" :angielski-p "https://liceum-internetowe.edu.pl/course/view.php?id=164" :angielski-r "https://liceum-internetowe.edu.pl/course/view.php?id=165" :wos "https://liceum-internetowe.edu.pl/course/view.php?id=227"}) @@ -90,10 +90,15 @@ (e/go driver (first (:lesson-links lesson-info))))) - (defn do-lesson [lesson] - (let [random-wait (fn [x] (fn [] (e/wait (+ x (* 4 (rand)))))) - random-short-wait (random-wait 2)] + (let [random-wait (fn [x] (fn [] + (let [time (+ x (* 4 (rand)))] + (println (str "I'm gonna wait " + time + "s to do my next movee!!")) + (e/wait time)))) + random-short-wait (random-wait 2) + random-lesson-wait (random-wait (* 40 60))] (login) (random-short-wait) (e/go driver (lesson lessons)) @@ -101,7 +106,7 @@ (check-first-button) (random-short-wait) (enter-first-lesson) - (random-short-wait) + (random-lesson-wait) (logout) true)) diff --git a/src/yasa/settings.clj b/src/yasa/settings.clj index d936515..df90bac 100644 --- a/src/yasa/settings.clj +++ b/src/yasa/settings.clj @@ -2,11 +2,11 @@ (def settings {:username (or nil ;; ENTER YOUR USERNAME - (or (System/getenv "YASA-USERNAME") + (or (System/getenv "YASA_USERNAME") (lazy-seq (throw (Exception. "No username provided!"))))) :password (or nil ;; ENTER YOUR PASSWORD - (or (System/getenv "YASA-PASSWORD") + (or (System/getenv "YASA_PASSWORD") (lazy-seq (throw (Exception. "No password provided!")))))}) -- cgit v1.2.3