Changeset - 5e29bc7ac9ff
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 13 years ago 2012-09-30 19:14:34
ohnobinki@ohnopublishing.net
Fill in more of the schedule search form for Calvin to fix an error that prevented crawling.
1 file changed with 21 insertions and 1 deletions:
0 comments (0 inline, 0 general)
school.d/calvin.crawl.inc
Show inline comments
 
@@ -117,6 +117,7 @@ function calvin_crawl_semester(array $sc
 
  $cookies = array();
 
  $uri = 'https://kvdata.calvin.edu/walive/WebAdvisor?type=P&pid=ST-WESTS12A&LASTTOKEN=NULL';
 
  $html = calvin_crawl_geturi($uri, $cookies, $school_crawl_log);
 
  $form_uri = $uri;
 
  $seed_dom = new DOMDocument();
 
  $seed_dom->loadHTML($html);
 
  $return_url = dom_input_value($seed_dom, 'RETURN.URL');
 
@@ -127,8 +128,17 @@ function calvin_crawl_semester(array $sc
 
   * the input form. The <select name="LIST.VAR1_1" id="LIST_VAR1_1"/>
 
   * is associated with subjects/departments.
 
   */
 
  $department_var1_list = array();
 
  foreach (school_crawl_form_select_array($seed_dom->getElementById('LIST_VAR1_1')) as $department_id => $department_name)
 
    $semester->department_name_set($department_id, trim(reset($department_name)));
 
    {
 
      $semester->department_name_set($department_id, trim(reset($department_name)));
 
      $department_var1_list[] = $department_id;
 
    }
 

	
 
  while (count($department_var1_list))
 
    {
 
      /* Start back on the form page... */
 
      $uri = $form_uri;
 

	
 
  /*
 
   * LIST.VAR<X>_<N>: <X> is the column, <N> is the row. There
 
@@ -183,6 +193,15 @@ function calvin_crawl_semester(array $sc
 
    }
 

	
 
  /*
 
   * Fill in some semesters.
 
   */
 
  foreach (array('1', '2', '3', '4', '5') as $var1_row)
 
    if (count($department_var1_list))
 
      {
 
	$form['LIST.VAR1_' . $var1_row] = array_shift($department_var1_list);
 
      }
 

	
 
  /*
 
   * VAR7 and VAR 8 is a constraint of times during which
 
   * courses meet
 
   */
 
@@ -419,6 +438,7 @@ function calvin_crawl_semester(array $sc
 
		    'ACTION*Grp:WSS.COURSE.SECTIONS' => 'NEXT',
 
		    );
 
    }
 
    }
 

	
 
  $has_stat = FALSE;
 
  foreach ($skipped_sections as $reason => $num)
0 comments (0 inline, 0 general)