diff --git a/README.md b/README.md index e4ea010..eb1ccdb 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,13 @@ Follow the setup below to use in Termux and Termux: Tasker - 4. Open Termux and run these commands: (with description) ```bash + + ## You may also simply run this equivalent script instead: + + curl -s https://raw.githubusercontent.com/IMXEren/competition-groups/master/setup.sh | bash + + ########################################################################################### + termux-setup-storage ## Allowing access to /storage/emulated/0 (or /sdcard) yes | pkg up -y ## Upgrade existing packages yes | pkg install -y tur-repo x11-repo ## Adding additional repos to extend package list @@ -29,10 +36,13 @@ Follow the setup below to use in Termux and Termux: Tasker - WCA_PASS="pass" \ ## password ./compgroups + ## Output - Login Successful - Time elapsed: 43.679098574s - Done... + + # Login Successful + # Time elapsed: 43.679098574s + # Done... + ## Anything other than them concludes to the error. ## On success, it should create a competitions.json which has the scraped data. ``` diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..ebe004d --- /dev/null +++ b/setup.sh @@ -0,0 +1,30 @@ +#!/data/data/com.termux/files/usr/bin/bash + +termux-setup-storage ## Allowing access to /storage/emulated/0 (or /sdcard) +yes | pkg up -y ## Upgrade existing packages +yes | pkg install -y tur-repo x11-repo ## Adding additional repos to extend package list +yes | pkg install -y chromium ## Installing chromium browser with chromedriver + +## Set `allow-external-apps` to true +curl -s https://raw.githubusercontent.com/IMXEren/automation/main/scripts/allow_external_apps.sh | bash + +## Download & setup zip package +mkdir -p ~/competition-groups && + cd ~/competition-groups && + arch=arm64 && + curl -L -o "cgroups-${arch}.zip" "https://github.com/IMXEren/competition-groups/releases/download/Assets/cgroups-${arch}.zip" && + unzip -o -d . cgroups-"${arch}".zip && + chmod 744 ./compgroups + +## Running the executable +cd ~/competition-groups || exit +WCA_USER="user" \ ## user id or email +WCA_PASS="pass" \ ## password +./compgroups + +## Output +# Login Successful +# Time elapsed: 43.679098574s +# Done... +## Anything other than them concludes to the error. +## On success, it should create a competitions.json which has the scraped data.