OscarScraper

Ruby code posted by Juan Villa
created at 01 May 10:15

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'oscar_scraper'

# Initialize Oscar Scraper
scraper = OscarScraper.new

# Log in to oscar (Replace sid and pin with your sid and pin)
logged_in = scraper.login :sid => "90XXXXXXX",
                          :pin => "XXXXXX"

if (logged_in)
  # Get list of all terms
  terms = scraper.get_terms
  # Find all sections that match the search criteria
  classes = scraper.find_class :term => terms["Fall 2008"],
                               :subject => "ECE",
                               :course => "3035"
  # Output search results
  classes.each { |c| puts c }
end
591 Bytes in 3 ms with coderay