Skip to content

Instantly share code, notes, and snippets.

@CosminNechifor
Created February 3, 2019 13:18
Show Gist options
  • Save CosminNechifor/f2de93ca467655af5c3907e0d3d2c699 to your computer and use it in GitHub Desktop.
Save CosminNechifor/f2de93ca467655af5c3907e0d3d2c699 to your computer and use it in GitHub Desktop.
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