Tuesday, November 8, 2011

My Backpack Student Grading System

At my school, we use an online program hosted on my school's servers called My Backpack to both report grades and assign homework. Over the years, I've realized that getting onto the website takes a while due to having to go through our school website first, and then passing a login screen. This is exacerbated when using a cell phone. So, this was my solution:
I created a mobile app that logs on to backpack and automatically scrapes the data you want to see (grades and assignments). At least, that's the idea for the finished product. As of now, this is what results after logging in on the app:
This is what the website equivalent to this would be:
The way it works is by spoofing the headers of a web browser in a page request. Although inefficient, without an RSS feed there's no other way to obtain the information (I haven't had much success with directly querying the server). Using the HttpClient library for Java, I store the security cookie along with some other required fields and pass the logon screen. Then, I query the server for the page with class info. I use Jsoup (a web scraping Java library) to parse through the HTML for the values containing the class information. This is what I've accomplished so far.

The more difficult task is retrieving the assignments. They're stored on another page, but in order to retrieve them the page header request needs to have a reference to the storage location in the server's database. I haven't yet figured out what the exact mechanism for this is, but once I have I'll be sure to update.


No comments:

Post a Comment