GW Course Schedule and Campus API
George Washington University recently released an iPhone app that allows students to look up the course schedule and each course’s open/closed status as well as browse an interactive map of the campus. Naturally, upon installing the app, the first thing to do is to try and ferret out the underlying XML API that powers it, a simple enough task given the right tools.
Below you can find the details on GW’s course schedule and campus map API endpoints, as well as an API wrapper to interact with it written in PHP. Feel free to grab the code below, or fork and contribute in the GitHub repository. Cool data that deserves to be shared with the world, no doubt.
Creative ideas on how best to leverage the information welcome in the comments below.
Please Note: I am not a GW employee, nor is use of the API explicitly authorized by the University. The code below is provided “as is” solely for educational purposes. If for any reason you would like this page removed, please contact me immediately and I will do so.
Course Schedule
Departments
- Endpoint:
http://my.gwu.edu/mod/pws/scheduleXML.cfm
- Parameters:
termCode=[YYYY][01=spring, 02=summer, 03=fall]
-
Returns:
<?xml version="1.0" encoding="iso-8859-1" ?> <departments> <department> <departmentcode><![CDATA[ACCY]]></departmentcode> <departmentname><![CDATA[Accountancy]]></departmentname> </department> <department> <departmentcode><![CDATA[AH]]></departmentcode> <departmentname><![CDATA[Art/Art History]]></departmentname> </department> </departments>
Courses
- Endpoint:
http://my.gwu.edu/mod/pws/scheduleXML.cfm
- Parameters:
termCode=[YYYY][01=spring, 02=summer, 03=fall]
deptCode=[Dept. Code]
-
Returns:
<?xml version="1.0" encoding="iso-8859-1" ?> <courses> <course> <coursedepartment><![CDATA[ACCY]]></coursedepartment> <coursenumber><![CDATA[6101]]></coursenumber> <coursecrn><![CDATA[55164]]></coursecrn> <coursetitle><![CDATA[FinAcctingI:BasicFinStatements]]></coursetitle> <courseinstructor><![CDATA[ Singleton, L]]></courseinstructor> <courselocation><![CDATA[<A HREF="http://www.gwu.edu/~map/building.cfm?BLDG=DUQUES" target="_blank" >DUQUES</a> 258]]></courselocation> <coursedays><![CDATA[MW 06:10PM - 09:05PM]]></coursedays> <coursetime><![CDATA[]]></coursetime> <coursestatus><![CDATA[OPEN]]></coursestatus> <coursesection><![CDATA[81]]></coursesection> <coursecredit><![CDATA[1.50 ]]></coursecredit> </course> <course> <coursedepartment><![CDATA[ACCY]]></coursedepartment> <coursenumber><![CDATA[6102]]></coursenumber> <coursecrn><![CDATA[55165]]></coursecrn> <coursetitle><![CDATA[Fin Accting II: FinAcc Choices]]></coursetitle> <courseinstructor><![CDATA[ Tarpley, R]]></courseinstructor> <courselocation><![CDATA[<A HREF="http://www.gwu.edu/~map/building.cfm?BLDG=DUQUES" target="_blank" >DUQUES</a> 258]]></courselocation> <coursedays><![CDATA[MW 06:10PM - 09:05PM]]></coursedays> <coursetime><![CDATA[]]></coursetime> <coursestatus><![CDATA[OPEN]]></coursestatus> <coursesection><![CDATA[80]]></coursesection> <coursecredit><![CDATA[1.50 ]]></coursecredit> </course> </courses>
Campus Map
Categories
- Endpoint:
http://citl.gwu.edu/iphonedev/maps/categories.xml
-
Returns:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <categories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <category> <categoryId>1</categoryId> <shortname>academic</shortname> <categoryName>Academic</categoryName> <state>Yes</state> </category> <category> <categoryId>2</categoryId> <shortname>administrative</shortname> <categoryName>Administrative</categoryName> <state>Yes</state> </category> </categories>
Buildings
- Endpoint:
http://citl.gwu.edu/iphonedev/maps/[shortname].xml
-
Returns:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <buildings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <building> <buildingNumber>153</buildingNumber> <campus>Foggy Bottom</campus> <UsageClassification>Academic</UsageClassification> <buildingName>1776 G St</buildingName> <address>1776 G St</address> <geoLocation>38.897984,-77.04146</geoLocation> <shortname>NA</shortname> <picturelink>http://www.gwu.edu/~newsctr/mobile/images/maps/1776-G-ST_UP_WLA_2010-6618.jpg</picturelink> </building> <building> <buildingNumber>136</buildingNumber> <campus>Foggy Bottom</campus> <UsageClassification>Academic</UsageClassification> <buildingName>1957 E St</buildingName> <address>1957 E St</address> <geoLocation>38.896193,-77.044294</geoLocation> <shortname>1957E</shortname> <picturelink>http://www.gwu.edu/~newsctr/mobile/images/maps/Elliot_School_UP_WLA_2010-3102.jpg</picturelink> </building> </buildings>
API Wrapper
Source
Usage
Initialize
<?php $gwapi = new gw_api; ?>
List Departments
<?php
$departments = $gwapi->get_schedule();
foreach ($departments as $department)
echo $department->departmentname . '<br />';
?>
Get Course Schedule for Fall 2011
<?php $courses = $gwapi->get_schedule('2011','03','ACCY');?>
Get Course Schedule for current term
<?php $courses = $gwapi->get_schedule(null,null,'ACCY'); ?>
Get map categories
<?php $categories = $gwapi->get_map(); ?>
Get Buildings
<?php $buildings = $gwapi->get_maps('academic'); ?>
If you enjoyed this post, you might also enjoy:
- Twelve tips for growing communities around your open source project
- Why open source
- How I re-over-engineered my home network for privacy and security
- 19 reasons why technologists don't want to work at your government agency
- How to make a product great
- 15 rules for communicating at GitHub
- Why WordPress
- The difference between 18F and USDS
- Everything an open source maintainer might need to know about open source licensing
- Octoversary - eight years of optimizing for developer happiness
- Everything a government attorney needs to know about open source software licensing
Ben Balter is the Director of Hubber Enablement within the Office of the COO at GitHub, the world’s largest software development platform, ensuring all Hubbers can do their best (remote) work. Previously, he served as the Director of Technical Business Operations, and as Chief of Staff for Security, he managed the office of the Chief Security Officer, improving overall business effectiveness of the Security organization through portfolio management, strategy, planning, culture, and values. As a Staff Technical Program manager for Enterprise and Compliance, Ben managed GitHub’s on-premises and SaaS enterprise offerings, and as the Senior Product Manager overseeing the platform’s Trust and Safety efforts, Ben shipped more than 500 features in support of community management, privacy, compliance, content moderation, product security, platform health, and open source workflows to ensure the GitHub community and platform remained safe, secure, and welcoming for all software developers. Before joining GitHub’s Product team, Ben served as GitHub’s Government Evangelist, leading the efforts to encourage more than 2,000 government organizations across 75 countries to adopt open source philosophies for code, data, and policy development. More about the author →
This page is open source. Please help improve it.
Edit