Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
With this script you can check your grade at ASO
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Please add your credentials"
echo "Usage: bash aso_grade.sh <username> <password>"
exit
fi
USR=$1
PWD=$2
VALUE=$(curl --silent -POST -H "Content-Type: application/x-www-form-urlencoded" -d "username=$USR&password=$PWD" https://sinu.utcluj.ro/note/default.asp)
ID=$(echo $VALUE | awk 2>/dev/null -F 'value=\"' '{print $2}' | awk 2>/dev/null -F '\">' '{print $1}')
if [ "$ID" = "default.asp" ]
then
echo "Invalid credentials"
exit
fi
GRADES=$(curl --silent -POST -H "Content-Type: application/x-www-form-urlencoded" -d "sid=$ID&hidNume_Facultate=Facultatea+de+Automatica+si+Calculatoare&hidNume_Specializare=Tehnologia+Informatiei-lic.&hidOperation=N&hidSelfSubmit=roluri.asp" https://sinu.utcluj.ro/note/roluri.asp)
NAME=$(echo $GRADES | awk 2>/dev/null -F 'Numele' '{print $2}' | awk 2>/dev/null -F '\<\/span\>\<br\>' '{print $1}' | awk 2>/dev/null -F 'bodytextstrong\"\> ' '{print $2}')
GRADE=$(echo $GRADES | awk 2>/dev/null -F 'Administrarea' '{print $2}' | awk 2>/dev/null -F '\/strong\>' '{print $1}' | awk 2>/dev/null -F '\<strong\>' '{print $2}' | awk 2>/dev/null -F '\<' '{print $1}' | tr -d '[:space:]')
echo $NAME your grade at ASO is: $GRADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.