Changeset - 63ff4e5ba0ec
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 13 years ago 2012-12-11 02:15:13
ohnobinki@ohnopublishing.net
Relax pagination-parsing regex so that it doesn’t care between CRLF and LF, prerequisite for fixing bug #146 (cornerstone support).
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
inc/school.crawl.webadvisor.inc
Show inline comments
 
@@ -594,49 +594,49 @@ function school_crawl_webadvisor_semeste
 
	  $time_start = school_crawl_time_format(strptime($meeting_info_matches[6], '%I:%M%p'));
 
	  $time_end = school_crawl_time_format(strptime($meeting_info_matches[7], '%I:%M%p'));
 
	  $meeting_place = $meeting_info_matches[8];
 

	
 
	  foreach (array('date_start', 'date_end', 'meeting_type', 'days', 'time_start', 'time_end', 'meeting_place', 'meeting_type') as $var)
 
	    school_crawl_logf($school_crawl_log, 10, "%s:%s", $var, ${$var});
 

	
 
	  $date_start_time = strptime($date_start, '%m/%d/%Y');
 
	  $date_end_time = strptime($date_end, '%m/%d/%Y');
 
	  if ($date_start_time !== FALSE)
 
	    $date_start_time = school_crawl_gmmktime($date_start_time, -5 * 60*60);
 
	  else
 
	    $date_start_time = NULL;
 
	  if ($date_end_time !== FALSE)
 
	    $date_end_time = school_crawl_gmmktime($date_end_time, -5 * 60*60) + 24*60*60;
 
	  else
 
	    $date_end_time = NULL;
 

	
 
	  $semester->section_meeting_add($section_id['department'], $section_id['course'], $title, $section_id['section'], $synonym,
 
					 new SectionMeeting($days, $time_start, $time_end, $meeting_place, $meeting_type, $faculty_name, $date_start_time, $date_end_time), 'default', $credits);
 

	
 
	    }
 
	}
 

	
 
      if (!preg_match(';Page ([0-9]+) of ([0-9]+)\</td\>$;m', $html, $pages))
 
      if (!preg_match(';Page ([0-9]+) of ([0-9]+)\\</td\\>;', $html, $pages))
 
	{
 
	  school_crawl_logf($school_crawl_log, 0, 'Unable to determine the number of pages in this resultset');
 
	  break;
 
	}
 

	
 
      school_crawl_logf($school_crawl_log, 8, "%s(): finished page %d of %d with %d courses.", __FUNCTION__, $pages[1], $pages[2], $list_row - 1);
 

	
 
      $form = array(
 
		    'ACTION*Grp:WSS.COURSE.SECTIONS' => 'NEXT',
 
		    );
 
    }
 
    }
 

	
 
  $has_stat = FALSE;
 
  foreach ($skipped_sections as $reason => $num)
 
    {
 
      if (!$num)
 
	continue;
 
      if (!$has_stat)
 
	school_crawl_logf($school_crawl_log, 7, 'Skipped some sections for <reason>: <number skipped>:');
 
      school_crawl_logf($school_crawl_log, 7, "%s: %d", $reason, $num);
 
    }
 

	
 
  /*
0 comments (0 inline, 0 general)