26 Commits
main ... 1.2

Author SHA1 Message Date
b646a06ec6 Current status not available for TFT
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 1m17s
2025-10-20 13:57:19 +02:00
35a92e7661 Current match info is unavailable due to API changes
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 1m26s
2025-10-20 13:51:57 +02:00
8a5ad8a470 new API key
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 1m15s
2025-10-20 08:34:05 +02:00
f0cbc564f8 Native image
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 2m41s
2025-10-20 08:08:20 +02:00
97d4325c02 deleting intellij metadata
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 2m49s
2025-09-18 22:56:28 +02:00
4e57651370 Example of formatting statistics into a table
All checks were successful
Compile and test using leiningen / Run tests (push) Successful in 55s
2025-08-26 10:29:25 +02:00
de3740741f Changes to publish artifacts
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 1m2s
2025-08-14 12:11:57 +02:00
452acf0cba Deploy to maven repository
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 1m0s
2025-08-14 10:15:51 +02:00
e97b04805d Deploy to maven repository
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 1m5s
2025-08-14 09:38:40 +02:00
3627795fb9 Deploy to maven repository
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 58s
2025-08-14 09:36:45 +02:00
42746bf347 Deploy to maven repository
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 59s
2025-08-14 09:32:40 +02:00
7ca242c863 Deploy to maven repository
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 1m50s
2025-08-14 09:27:21 +02:00
60dc3d6708 Merge remote-tracking branch 'refs/remotes/origin/1.2' into 1.2
All checks were successful
Compile and test using leiningen / Run tests (push) Successful in 57s
2025-08-13 15:43:34 +02:00
2f1a658235 Deactivate cache 2025-08-13 15:42:54 +02:00
450ff25c46 Deactivate cache
All checks were successful
Compile and test using leiningen / Run tests (push) Successful in 47s
2025-08-13 15:38:29 +02:00
e63352e7a8 Setting version to 1.2.0
Some checks failed
Compile and test using leiningen / Run tests (push) Has been cancelled
2025-08-13 15:37:11 +02:00
88c6e93715 More cleaning after rebase
Some checks failed
Compile and test using leiningen / Run tests (push) Has been cancelled
2025-08-13 15:35:44 +02:00
be4ccf088f Resolving conflicts after rebase
Some checks failed
Compile and test using leiningen / Run tests (push) Failing after 6m2s
2025-08-13 15:24:42 +02:00
22bd6c766b Update README.md 2025-08-13 15:19:26 +02:00
f77815ad7f Reestrcture and new graph library 2025-08-13 15:19:23 +02:00
e75d9219e1 Update README.md
Added idea for charts
2025-08-13 15:18:06 +02:00
2c4f836829 graph tests 2025-08-13 15:16:35 +02:00
e9064f9b61 Update README.md 2025-07-15 19:41:28 +02:00
33410e68ed Reestrcture and new graph library 2025-07-15 19:17:51 +02:00
9cf756ffbd Update README.md
Added idea for charts
2025-07-08 15:46:23 +02:00
28720bfcd5 graph tests 2025-07-07 21:55:07 +02:00
48 changed files with 452 additions and 442 deletions

View File

@@ -16,9 +16,9 @@ jobs:
- name: Install java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
distribution: "temurin"
java-version: "21"
# Install Leiningen
- name: Install Leiningen
run: |
@@ -29,15 +29,15 @@ jobs:
# Install dependencies
- name: Install dependencies
run: lein deps
# Optional: cache dependencies
- name: Cache dependencias
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-m2-
#- name: Cache dependencias
# uses: actions/cache@v4
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-m2-${{ hashFiles('**/project.clj') }}
# restore-keys: |
# ${{ runner.os }}-m2-
# Get leiningen's version
- name: Get leiningen version
@@ -46,14 +46,15 @@ jobs:
# Test the code
- name: Run tests
env:
TFT_API: ${{ secrets.DEV_API }}
TFT_API: ${{ secrets.DEV_API }}
run: lein test
# Send jar to repository
- name: Deploy on Gitea Maven
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
env:
GITEA_USER: ${{ secrets.DEPLOY_USER }}
GITEA_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
lein deploy gitea
lein deploy gitea

4
.gitignore vendored
View File

@@ -15,4 +15,6 @@ pom.xml.asc
.lsp
.calva
*.svg
/logs
/logs/*
log.txt

5
.idea/.gitignore generated vendored
View File

@@ -1,5 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Environment-dependent path to Maven home directory
/mavenHomeManager.xml

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClojureProjectResolveSettings">
<currentScheme>IDE</currentScheme>
</component>
</project>

18
.idea/compiler.xml generated
View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<wildcardResourcePatterns>
<entry name="!dev-resources:*" />
<entry name="!resources:*" />
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
</component>
</project>

View File

@@ -1,7 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="project">
<words>
<w>puuid</w>
</words>
</dictionary>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: buddy/buddy-core:1.12.0-430">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/buddy/buddy-core/1.12.0-430/buddy-core-1.12.0-430.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: cheshire:6.0.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/cheshire/cheshire/6.0.0/cheshire-6.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: cli-matic:0.5.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/cli-matic/cli-matic/0.5.4/cli-matic-0.5.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: clj-http:2.0.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/clj-http/clj-http/2.0.0/clj-http-2.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: clj-tuple:0.2.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: com.fasterxml.jackson.core/jackson-core:2.18.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.18.3/jackson-core-2.18.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: com.fasterxml.jackson.dataformat/jackson-dataformat-cbor:2.18.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.18.3/jackson-dataformat-cbor-2.18.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: com.fasterxml.jackson.dataformat/jackson-dataformat-smile:2.18.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/dataformat/jackson-dataformat-smile/2.18.3/jackson-dataformat-smile-2.18.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: commons-codec:1.10">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.10/commons-codec-1.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: commons-io:2.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-io/commons-io/2.4/commons-io-2.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: commons-logging:1.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: expound:0.9.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/expound/expound/0.9.0/expound-0.9.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: nrepl:1.0.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/nrepl/nrepl/1.0.0/nrepl-1.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.apache.httpcomponents/httpclient:4.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient/4.5/httpclient-4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.apache.httpcomponents/httpcore:4.4.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore/4.4.1/httpcore-4.4.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.apache.httpcomponents/httpmime:4.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpmime/4.5/httpmime-4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.bouncycastle/bcpkix-jdk18on:1.78.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/bouncycastle/bcpkix-jdk18on/1.78.1/bcpkix-jdk18on-1.78.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.bouncycastle/bcprov-jdk18on:1.78.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/bouncycastle/bcprov-jdk18on/1.78.1/bcprov-jdk18on-1.78.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.bouncycastle/bcutil-jdk18on:1.78.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/bouncycastle/bcutil-jdk18on/1.78.1/bcutil-jdk18on-1.78.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/clojure:1.11.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/clojure/1.11.1/clojure-1.11.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/core.specs.alpha:0.2.62">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/java.classpath:1.1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/java.classpath/1.1.0/java.classpath-1.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/spec.alpha:0.3.218">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/test.check:1.1.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/test.check/1.1.1/test.check-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/tools.cli:1.1.230">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/tools.cli/1.1.230/tools.cli-1.1.230.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/tools.namespace:1.5.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/tools.namespace/1.5.0/tools.namespace-1.5.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.clojure/tools.reader:1.4.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/clojure/tools.reader/1.4.0/tools.reader-1.4.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: org.nrepl/incomplete:0.1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/nrepl/incomplete/0.1.0/incomplete-0.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: potemkin:0.4.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/potemkin/potemkin/0.4.1/potemkin-0.4.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: riddley:0.1.10">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/riddley/riddley/0.1.10/riddley-0.1.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: slingshot:0.12.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/slingshot/slingshot/0.12.2/slingshot-0.12.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Leiningen: tigris:0.1.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/tigris/tigris/0.1.2/tigris-0.1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

11
.idea/misc.xml generated
View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="LeiningenProjectsManager">
<option name="projectFiles">
<set>
<option value="file://$PROJECT_DIR$/project.clj" />
</set>
</option>
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="21" project-jdk-type="JavaSDK" />
</project>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/riot-clojure.iml" filepath="$PROJECT_DIR$/riot-clojure.iml" />
</modules>
</component>
</project>

7
.idea/vcs.xml generated
View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -112,7 +112,69 @@ Get te same data in CSV and store it in a file:
Don't format durations, show them in seconds
$ ./riot t <username> <tag> -s "2025-03-01" --no-format-durations
### Graphs
Posible ASCII art charts
#### Simple day
A one dimension diagram. Draw a tick each day the player has played
```
####### ### ###### ###########
------------------------------------------------------------------------------------------
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
june
```
#### Day and hour
The x axis represents days of month, while y axis represents hours of each day. A tick is drawed in the hour
when the player was playing.
```
23 |
22 |
21 |
20 |
19 | # #
18 | # # #
17 | # # # #
16 | #
15 | # # # #
14 | # # # #
13 | #
12 | # # # #
11 | # # # # #
10 | # # # #
09 | # #
08 |
07 |
06 |
05 |
04 |
03 |
02 |
01 |
00 |
------------------------------------------------------------------------------------------
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
june
```
## Interesting graphic and UI libraries
- Raster SVG: https://github.com/soulspace-org/cmp.batik
- Modify SVG graphics: https://github.com/stathissideris/dali
- Create Vega-lite SVG graphics: https://github.com/techascent/tech.viz
- Enhance CLI text: https://github.com/clj-commons/pretty?tab=readme-ov-file
- Universal UI: https://github.com/phronmophobic/membrane?tab=readme-ov-file
- Interesting libraries: https://www.clojure-toolbox.com/
## License

View File

@@ -1,5 +1,5 @@
(defproject riot-clojure "1.1.0"
:description "Utility for getting for Riot APIs in Clojure"
(defproject riot-clojure "1.2.0"
:description "Utility for getting data from Riot APIs in Clojure"
:url "https://git.rcorral.es/ruben/riot-clojure"
:license {:name "MIT"
@@ -17,21 +17,34 @@
[org.clj-commons/pretty "3.5.0"] ;; https://github.com/clj-commons/pretty
[org.clojure/tools.logging "1.3.0"] ;; https://github.com/clojure/tools.logging
[org.slf4j/slf4j-api "2.0.17"] ;; https://www.slf4j.org/
[ch.qos.logback/logback-classic "1.5.18"]]
:jvm-opts ["-Dclojure.tools.logging.factory=clojure.tools.logging.impl/slf4j-factory"]
[ch.qos.logback/logback-classic "1.5.18"]
:plugins [[io.taylorwood/lein-native-image "0.3.1"]]
;;; LIBS FOR GRAPHS, SOME OF THEM WILL BE REMOVED IN THE FUTURE
;[com.hypirion/clj-xchart "0.2.0"] ;; Graphs and charts
;[aerial.hanami "0.15.1"] ;; Parse vega-lite data and generate graphics
;[folcon/oz "1.6.0-alpha6.2"] ;; Parse vega and vega-lite
[metasoarous/oz "1.6.0-alpha36"] ;; Other version of Oz
;[metasoarous/oz "2.0.0-alpha5"] ;; Newer version of Oz
[incanter/incanter-charts "1.9.3"] ;; graphics with Incanter
;[hswick/jutsu "0.1.1"] ;; Wrapper para plotly
[techascent/tech.viz "6.00-beta-16-4"] ;; Vega-lite parser (https://github.com/techascent/tech.viz)
]
:plugins [[io.taylorwood/lein-native-image "0.3.1"]] ;; Compile to native using graal
:main ^:skip-aot riot.app
:target-path "target/%s"
:native-image {:name "riot" ;; name of output image, optional
:graal-bin "/home/ruben/.sdkman/candidates/java/21.0.2-graalce/" ;; path to GraalVM home, optional
:opts ["--verbose"]} ;; pass-thru args to GraalVM native-image, optional
:opts ["--verbose" "-H:+AllowDeprecatedBuilderClassesOnImageClasspath" "--no-fallback"]} ;; pass-thru args to GraalVM native-image, optional
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}
:native-image {:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}
;:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
}
:native-image {:jvm-opts ["-Dclojure.compiler.direct-linking=true" "--initialize-at-build-time"]
}
:dev {:dependencies [[org.clojure/test.check "1.1.1"]]
:plugins [[io.taylorwood/lein-native-image "0.3.1"]
[lein-binplus "0.6.8"]]}}
@@ -42,12 +55,16 @@
:jvm-opts ["-server" "-Dfile.encoding=utf-8" "$JVM_OPTS"]}
;; Deploy to repository
:repositories {"gitea"
{:url "https://git.rcorral.es/api/packages/ruben/maven"
:username :env/DEPLOY_USER
:password :env/DEPLOY_TOKEN}}
:repositories [["gitea" {:url "https://git.rcorral.es/api/packages/ruben/maven"
:username :env/DEPLOY_USER
:password :env/DEPLOY_TOKEN
:sign-releases false}]]
:deploy-repositories [["releases" :gitea]
["snapshots" :gitea]]
;; Test selectors
:test-selectors {:default (complement (some-fn :tft :timezone))
:tft :tft
:timezone :timezone})

View File

@@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="BuildSystem">
<option name="buildSystemId" value="LEININGEN" />
<option name="displayName" value="riot-clojure:1.0.0" />
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/dev-resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Leiningen: buddy/buddy-core:1.12.0-430" level="project" />
<orderEntry type="library" name="Leiningen: cheshire:6.0.0" level="project" />
<orderEntry type="library" name="Leiningen: cli-matic:0.5.4" level="project" />
<orderEntry type="library" name="Leiningen: clj-http:2.0.0" level="project" />
<orderEntry type="library" name="Leiningen: clj-tuple:0.2.2" level="project" />
<orderEntry type="library" name="Leiningen: com.fasterxml.jackson.core/jackson-core:2.18.3" level="project" />
<orderEntry type="library" name="Leiningen: com.fasterxml.jackson.dataformat/jackson-dataformat-cbor:2.18.3" level="project" />
<orderEntry type="library" name="Leiningen: com.fasterxml.jackson.dataformat/jackson-dataformat-smile:2.18.3" level="project" />
<orderEntry type="library" name="Leiningen: commons-codec:1.10" level="project" />
<orderEntry type="library" name="Leiningen: commons-io:2.4" level="project" />
<orderEntry type="library" name="Leiningen: commons-logging:1.2" level="project" />
<orderEntry type="library" name="Leiningen: expound:0.9.0" level="project" />
<orderEntry type="library" name="Leiningen: nrepl:1.0.0" level="project" />
<orderEntry type="library" name="Leiningen: org.apache.httpcomponents/httpclient:4.5" level="project" />
<orderEntry type="library" name="Leiningen: org.apache.httpcomponents/httpcore:4.4.1" level="project" />
<orderEntry type="library" name="Leiningen: org.apache.httpcomponents/httpmime:4.5" level="project" />
<orderEntry type="library" name="Leiningen: org.bouncycastle/bcpkix-jdk18on:1.78.1" level="project" />
<orderEntry type="library" name="Leiningen: org.bouncycastle/bcprov-jdk18on:1.78.1" level="project" />
<orderEntry type="library" name="Leiningen: org.bouncycastle/bcutil-jdk18on:1.78.1" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/clojure:1.11.1" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/core.specs.alpha:0.2.62" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/java.classpath:1.1.0" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/spec.alpha:0.3.218" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/test.check:1.1.1" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/tools.cli:1.1.230" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/tools.namespace:1.5.0" level="project" />
<orderEntry type="library" name="Leiningen: org.clojure/tools.reader:1.4.0" level="project" />
<orderEntry type="library" name="Leiningen: org.nrepl/incomplete:0.1.0" level="project" />
<orderEntry type="library" name="Leiningen: potemkin:0.4.1" level="project" />
<orderEntry type="library" name="Leiningen: riddley:0.1.10" level="project" />
<orderEntry type="library" name="Leiningen: slingshot:0.12.2" level="project" />
<orderEntry type="library" name="Leiningen: tigris:0.1.2" level="project" />
</component>
</module>

View File

@@ -140,7 +140,7 @@
;; More info: https://github.com/l3nz/cli-matic/blob/master/README.md
(def CONFIGURATION
{:app {:command "riot"
:version "1.1.0"
:version "1.2.0"
:description ["Get how much you play your favourite games"
""
"EXAMPLE USAGES:"

View File

@@ -36,7 +36,7 @@
;;;; API KEYS
(def DEV_KEY "RGAPI-ec3779d1-bc61-4a2e-a071-34addcc6bd56")
(def LOL_KEY "jXL+gA3LIeBPBvrOhLOYSZCiURC7eOtwMXahkxtwpdj6JDtT5NMu25zMz+UY2+9MuHBADjUJh46jSanrV5OBag==")
(def LOL_KEY "RqFfnwRNwf2UkRNvxwr6tE11J7KSjzRMtOecqm1Aw+PWOXWSil9yaNiglVeKinEddQk4BQs7N/G1r42MeyMZHA==")
(def TFT_KEY (encrypt-data DEV_KEY secret-key iv))
(defn get-lol-api-key
@@ -317,7 +317,10 @@
:api-key api-key
:debug debug)
(catch [:status 404] _
(when print-not-active (println "No active LoL match"))))))
(when print-not-active (println "No active LoL match")))
(catch [:status 403] _
(println "Current status not available")))))
#_{:clj-kondo/ignore [:unresolved-symbol]}
@@ -337,7 +340,9 @@
:api-key api-key
:debug debug)
(catch [:status 404] _
(when print-not-active (println "No active tft match"))))))
(when print-not-active (println "No active tft match")))
(catch [:status 403] _
(println "Current status not available")))))

View File

@@ -9,7 +9,7 @@
[clojure.string :as str]
[cheshire.core :refer :all]
[riot.core :refer :all]
[clj-commons.format.table :refer [print-table] :as table])
[clj-commons.format.table :refer [print-table] :as table])
(:gen-class))
@@ -77,8 +77,8 @@
(when (some? seconds)
(if (< seconds 3600)
(format "%02d:%02d" (quot seconds 60) (rem seconds 60))
(format "%02d:%02d:%02d"
(quot seconds 3600)
(format "%02d:%02d:%02d"
(quot seconds 3600)
(- (quot seconds 60) (* 60 (quot seconds 3600)))
(rem seconds 60)))))
@@ -93,7 +93,7 @@
(defn match-today?
"Predicate that is true if the match has been played today.
A match has been played today if its start date or end date is from today"
[match]
(or
@@ -247,4 +247,7 @@
(comment
(calculate-statistics '({:winner true} {:winner false} {:winner true}))
)
(let [data '({:winner true} {:winner false} {:winner true})]
(pp/print-table [:name :all :lol :tft] (concat (for [k (keys data)] (assoc (k data) :name (name k))))))
)

View File

@@ -0,0 +1,323 @@
(ns riot.graph_experiments
(:use riot.data)
(:require ;[com.hypirion.clj-xchart :as c]
[clojure.pprint :as pprint]
[clojure.math :as m]
[clojure.core.matrix :as mtx])
(:require [incanter.core :as incanter]
[incanter.stats :as stats]
[incanter.charts :as charts]
[incanter.datasets :as datasets])
(:require [oz.core :as oz])
(:require [tech.viz.vega :as vega]))
;; ;;;; XCHART
;; ;; XY chart
;; (def xchart_xy
;; (c/xy-chart {"Expected rate" [(range 10) (range 10)]
;; "Actual rate" [(range 10) (map #(+ % (rand-int 5) -2) (range 10))]}))
;; (comment
;; (c/view xchart_xy))
;; ;;;; HANAMI
;; (comment
;; (hc/xform ht/point-chart
;; :UDATA "data/cars.json"
;; :X "Horsepower" :Y "Miles_per_Gallon" :COLOR "Origin"))
;;;; OZ
(def test-plot
{:data {:values
[{:time "18:00" :volume 10}
{:time "18:02" :volume 41}
{:time "18:07" :volume 192}
{:time "18:30" :volume 257}
{:time "19:00" :volume 300}]
:format {:parse {:time "date:'%H:%M'"}}}
:encoding {:x {:field "time" :type "temporal" :timeUnit "hoursminutes"}
:y {:field "volume" :type "quantitative"}}
:mark "point"})
;;; to compile and view in Clojure - Oz:
(comment
(do
(println "calling (oz/start-server!)")
(oz/start-server!)
(println "calling (oz/view!)")
(oz/view! test-plot)
(println "calling (Thread/sleep)")
(Thread/sleep 5000))
)
;;;; INCANTER
;; Simple histogram
(comment
(incanter/view (charts/histogram (stats/sample-normal 1000))))
;; Boxplot demo
(defn create-box-plot [data]
(let [box-plot (charts/box-plot data
:title "Box Plot Example"
:y-label "Values"
:x-label "Dataset")]
(incanter/view box-plot)))
(def sample-data [5, 7, 8, 9, 10, 14, 15, 21, 23, 23, 24, 26, 28, 30, 37])
(comment
(create-box-plot sample-data))
;; Scatter
(comment
(incanter/view (charts/scatter-plot :Sepal.Length :Sepal.Width
:data (datasets/get-dataset :iris)))
(clojure.pprint/pprint (datasets/get-dataset :iris)))
;; Scatter grouped
(comment
(incanter/view (charts/scatter-plot :Sepal.Length :Sepal.Width
:group-by :Species
:data (datasets/get-dataset :iris)
:legend true)))
;; Scatter matrix (too complicated)
(comment
(incanter/view (charts/scatter-plot-matrix
(datasets/get-dataset :iris)
:nbins 20
:group-by :Species))
(incanter/with-data (datasets/get-dataset :iris) (incanter/view (charts/scatter-plot-matrix :nbins 20 :group-by :Species)))
(incanter/view (charts/scatter-plot-matrix
(datasets/get-dataset :chick-weight)
:group-by :Diet
:nbins 20)))
;; Heatmaps
(comment
(defn f [x y] (incanter/sin (incanter/sqrt (mtx/add (incanter/sq x) (incanter/sq y)))))
(incanter/view (charts/heat-map f -10 10 -15 15))
(incanter/view (charts/heat-map f -10 10 -10 10 :color? false))
(incanter/view (charts/heat-map f 5 10 5 10 :include-zero? false))
)
;; Personalize a scatter
(def my-data '({:start 1751537581404,
:end 1751539178158,
:duration 1583,
:active false,
:game-type "lol",
:id "EUW1_7450441192",
:winner true}
{:start 1751489335800,
:end 1751491099813,
:duration 1748,
:active false,
:game-type "lol",
:id "EUW1_7450117155",
:winner true}
{:start 1751486177961,
:end 1751487764068,
:duration 1568,
:active false,
:game-type "lol",
:id "EUW1_7450048068",
:winner true}
{:start 1751484450321,
:end 1751485680510,
:duration 1201,
:active false,
:game-type "lol",
:id "EUW1_7450013510",
:winner true}
{:start 1751400380588,
:end 1751401545922,
:duration 1133,
:active false,
:game-type "lol",
:id "EUW1_7449129548",
:winner true}
{:start 1751398221584,
:end 1751399322722,
:duration 1020,
:active false,
:game-type "lol",
:id "EUW1_7449082553",
:winner false}
{:start 1751394541765,
:end 1751396611534,
:duration 2040,
:active false,
:game-type "lol",
:id "EUW1_7449005657",
:winner false}
{:start 1751388187077,
:end 1751390143357,
:duration 1937,
:active false,
:game-type "lol",
:id "EUW1_7448887620",
:winner true}
{:start 1751384103153,
:end 1751385903519,
:duration 1767,
:active false,
:game-type "lol",
:id "EUW1_7448818616",
:winner false}
{:start 1751363056183,
:end 1751364555063,
:duration 1462,
:active false,
:game-type "lol",
:id "EUW1_7448564681",
:winner false}))
(defn extract-date-millis
"Extract date from a long epoch timestamp in milliseconds"
[x]
;(java.util.Date. x)
(let [date (new java.util.Date x)]
(. (java.util.Date. (. date getYear) (. date getMonth) (. date getDay)) getTime)))
(defn extract-date
"Extract date from a long epoch timestamp in milliseconds"
[x]
;(java.util.Date. x)
(let [date (new java.util.Date x)]
(java.util.Date. (. date getYear) (. date getMonth) (. date getDay))))
(comment
(extract-date-millis 1751363056183)
(. (extract-date-millis 1751363056183) getTime)
)
(defn extract-hour
"Extract hour from a long epoch timestamp in milliseconds"
[x]
;(java.util.Date. x)
(let [date (new java.util.Date x)]
(. date getHours)))
(comment
(java.util.Date. 1751537581404)
(java.util.Date. 1751539178158)
(extract-hour 1751537581404)
(extract-hour 1751539178158)
)
(defn extract-active-hours-millis
[match]
(when (every? some? [ (:start match) (:end match)])
(let [d-ini (extract-date-millis (:start match))
d-end (extract-date-millis (:end match))
h-ini (extract-hour (:start match))
h-end (extract-hour (:end match))
game-type (:game-type match)
winner (:winner match)]
(if (= d-ini d-end)
(for [day [d-ini]
hour (range h-ini (inc h-end))]
[day hour game-type winner])
(concat
(for [day [d-ini]
hour (range h-ini 24)]
[day hour game-type winner])
(for [day [d-ini]
hour (range 0 (inc h-end))]
[day hour game-type winner]))))))
(defn extract-active-hours
[match]
(when (every? some? [(:start match) (:end match)])
(let [d-ini (extract-date (:start match))
d-end (extract-date (:end match))
h-ini (extract-hour (:start match))
h-end (extract-hour (:end match))
game-type (:game-type match)
winner (:winner match)]
(if (= d-ini d-end)
(for [day [d-ini]
hour (range h-ini (inc h-end))]
[day hour game-type winner])
(concat
(for [day [d-ini]
hour (range h-ini 24)]
[day hour game-type winner])
(for [day [d-ini]
hour (range 0 (inc h-end))]
[day hour game-type winner]))))))
(comment
(extract-active-hours-millis (first my-data))
(partition 4 (flatten (map extract-active-hours-millis my-data)))
)
(defn extract-dataset-millis
[matches]
(incanter/dataset
[:days :hours :game-type :winner]
(partition 4 (flatten (map extract-active-hours-millis matches)))))
(defn extract-dataset
[matches]
(incanter/dataset
[:days :hours :game-type :winner]
(partition 4 (flatten (map extract-active-hours matches)))))
(comment
(extract-dataset-millis my-data)
(extract-dataset my-data)
(incanter/view (charts/scatter-plot :days :hours
:data (extract-dataset-millis my-data)
:group-by :game-type
:x-label "Day"
:y-label "Hour"
:legend false))
)
(comment
(defn process-my-data [x y] (+ x y (m/random)))
(incanter/view (charts/heat-map process-my-data
-10 10 -15 15
:x-label "Day"
:y-label "Hour"
:z-label "Count"
:color? true
:include-zero? false))
)
;;;; tech.viz
(comment
(let [ my-graph (vega/scatterplot [{:a 1 :b 2} {:a 2 :b 3}] :a :b)]
(vega/vega->svg-file my-graph "timeseries.svg"))
)