Skip to content

Instantly share code, notes, and snippets.

@rosshadden
Created July 24, 2013 03:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosshadden/6067801 to your computer and use it in GitHub Desktop.
Save rosshadden/6067801 to your computer and use it in GitHub Desktop.
Script that takes one argument (a class id) and tells you how many seats are available for the class at University of Cincinnati.
#!/bin/bash
curl 'https://webapps2.uc.edu/scheduleofclasses/Details.asmx/Class' -H 'Pragma: no-cache' -H 'Origin: https://webapps2.uc.edu' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Host: webapps2.uc.edu' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1568.0 Safari/537.36' -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H 'X-Requested-With: XMLHttpRequest' -H 'Cookie: __qca=P0-1621544612-1365361687310; ASP.NET_SessionId=gnsrz1rul2nvx51h4f2zblzq; webapps2uceducookie=ey5hOkc7j+t/KpNyYpKoOeYlNKHEwOQcVbv8g/JMr5HSxFjEI92jFDEib/DGPIvDXNRCeVWiP7lgUQ==; CookiesChecked=true; .ASPXAUTH=6A0499BF7BCD661E80CA972504265E9A47B8E972104A357E8BB09E3EA29D7E91A9E83E9EC27F80EE8BD798A4785B2B7A5E13C21E5F19379EB2C9F0518CC9338B3043B731C82959DC8101524738A70257E92F0B9BC0773037CD1100817828E862321B5241746AFFB3234DA4B4E4A9AFD06BF8B85B; __RequestVerificationToken_L1N0dWRlbnRJQVBSZXZpZXc_=qhB91oG/zb+WOPttgkPTwInScUeuMjLQA3fFLb3h5q+ooZYr7iuOrwuYo2iWdz/dgaZrgGMDFXlNxtBf1HZe8ZQ92iywNaGv736kIN92IhPAPi53yDsyvHkYwPJvhbYGTe/iZw==; SessionPersistence-publish=CLIENTCONTEXT%3A%3DvisitorId%3D%2CvisitorId_xss%3D%7CPROFILEDATA%3A%3D%7C; __utma=2905140.1418251989.1353716870.1374616233.1374618222.10; __utmc=2905140; __utmz=2905140.1374618222.10.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); s_cc=true; s_sq=%5B%5BB%5D%5D' -H 'Connection: keep-alive' -H 'Referer: https://webapps2.uc.edu/scheduleofclasses/' --data-binary "{ classId: $1 }" --compressed | egrep -o "Seats Available: \w*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment