Skip to content

Instantly share code, notes, and snippets.

@cshjin
Created August 5, 2014 23:22
Show Gist options
  • Save cshjin/6ed3ab9a787d6ec98a3f to your computer and use it in GitHub Desktop.
Save cshjin/6ed3ab9a787d6ec98a3f to your computer and use it in GitHub Desktop.
This is the processing file to get online courses of IIT(Illinois Institution of Technology),
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 28 10:28:18 2013
@author: King
"""
import httplib
import urllib2
subs = ['BIOL', 'CAE', 'CHE', 'CHEM', 'COM', 'CS', 'CSP', 'ECE', 'ECON', 'ENVE',
'FPE', 'FST', 'INTM', 'IPRO', 'ITMD', 'ITMM', 'ITMO', 'ITMS',
'ITMT', 'MATH', 'MMAE', 'PHYS', 'PSYC', 'TECH']
for sub in subs:
for i in range(100, 700):
conn = httplib.HTTPConnection('media.iitonline.iit.edu')
if len(sub) == 2:
url = '/lectures/'+sub+'-'+str(i)+'-01-/index.html'
elif len(sub) == 3:
url = '/lectures/'+sub+'-'+str(i)+'-01/index.html'
elif len(sub) == 4:
url = '/lectures/'+sub+'-'+str(i)+'-0/index.html'
#conn.request('HEAD', '/lectures/CS-480-01-/index.html')
conn.request('HEAD', url)
if conn.getresponse().status == 200:
cont = urllib2.urlopen('http://media.iitonline.iit.edu' + url).read()
print cont[cont.find('h4')+3:cont.find('/h4')-1].split('</br>')[2]
print '\t http://media.iitonline.iit.edu' + url
print ' '
@cshjin
Copy link
Author

cshjin commented Jan 21, 2015

Not available from 2015 Spring.
🙅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment