summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2024-04-24 11:07:31 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2024-04-24 11:07:31 +0200
commit83a8f2873caa11c0151a43099abee08341f02ccf (patch)
tree22fe74c0cbc8e5e35fa0b51d162c1ed1e8d1fd63 /src
parent9c4854b2a720cca88750544030c457c4e31a6140 (diff)
downloadyasa-83a8f2873caa11c0151a43099abee08341f02ccf.tar.gz
yasa-83a8f2873caa11c0151a43099abee08341f02ccf.zip
Update for 8th semestr :)HEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/yasa/core.clj17
-rw-r--r--src/yasa/settings.clj4
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 @@
10 :cocpit "https://liceum-internetowe.edu.pl/my/"}) 10 :cocpit "https://liceum-internetowe.edu.pl/my/"})
11 11
12(def lessons 12(def lessons
13 {:polski "https://liceum-internetowe.edu.pl/course/view.php?id=163" 13 {:polski "https://liceum-internetowe.edu.pl/course/view.php?id=244"
14 :matematyka "https://liceum-internetowe.edu.pl/course/view.php?id=171" 14 :matematyka "https://liceum-internetowe.edu.pl/course/view.php?id=177"
15 :angielski-p "https://liceum-internetowe.edu.pl/course/view.php?id=164" 15 :angielski-p "https://liceum-internetowe.edu.pl/course/view.php?id=164"
16 :angielski-r "https://liceum-internetowe.edu.pl/course/view.php?id=165" 16 :angielski-r "https://liceum-internetowe.edu.pl/course/view.php?id=165"
17 :wos "https://liceum-internetowe.edu.pl/course/view.php?id=227"}) 17 :wos "https://liceum-internetowe.edu.pl/course/view.php?id=227"})
@@ -90,10 +90,15 @@
90 (e/go driver (first (:lesson-links lesson-info))))) 90 (e/go driver (first (:lesson-links lesson-info)))))
91 91
92 92
93
94(defn do-lesson [lesson] 93(defn do-lesson [lesson]
95 (let [random-wait (fn [x] (fn [] (e/wait (+ x (* 4 (rand)))))) 94 (let [random-wait (fn [x] (fn []
96 random-short-wait (random-wait 2)] 95 (let [time (+ x (* 4 (rand)))]
96 (println (str "I'm gonna wait "
97 time
98 "s to do my next movee!!"))
99 (e/wait time))))
100 random-short-wait (random-wait 2)
101 random-lesson-wait (random-wait (* 40 60))]
97 (login) 102 (login)
98 (random-short-wait) 103 (random-short-wait)
99 (e/go driver (lesson lessons)) 104 (e/go driver (lesson lessons))
@@ -101,7 +106,7 @@
101 (check-first-button) 106 (check-first-button)
102 (random-short-wait) 107 (random-short-wait)
103 (enter-first-lesson) 108 (enter-first-lesson)
104 (random-short-wait) 109 (random-lesson-wait)
105 (logout) 110 (logout)
106 true)) 111 true))
107 112
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 @@
2 2
3(def settings 3(def settings
4 {:username (or nil ;; ENTER YOUR USERNAME 4 {:username (or nil ;; ENTER YOUR USERNAME
5 (or (System/getenv "YASA-USERNAME") 5 (or (System/getenv "YASA_USERNAME")
6 (lazy-seq 6 (lazy-seq
7 (throw (Exception. "No username provided!"))))) 7 (throw (Exception. "No username provided!")))))
8 :password (or nil ;; ENTER YOUR PASSWORD 8 :password (or nil ;; ENTER YOUR PASSWORD
9 (or (System/getenv "YASA-PASSWORD") 9 (or (System/getenv "YASA_PASSWORD")
10 (lazy-seq 10 (lazy-seq
11 (throw (Exception. "No password provided!")))))}) 11 (throw (Exception. "No password provided!")))))})
12 12