Skip to content

Instantly share code, notes, and snippets.

@rugbyprof
Created August 25, 2014 22:51
Show Gist options
  • Select an option

  • Save rugbyprof/8ab522319a5d8d0404a8 to your computer and use it in GitHub Desktop.

Select an option

Save rugbyprof/8ab522319a5d8d0404a8 to your computer and use it in GitHub Desktop.
Create a beginning grade book from a summary list from banner.
<?php
//Get html from a summary email list on banner.
//If it's multiple pages, just append each page into one file
//
$file = file("student_emails.txt");
$fp = fopen("3013_distribution_list.csv","w");
fwrite($fp,"name,display name,email address\n");
for($i=0;$i<sizeof($file);$i++){
if($email = strstr($file[$i],'<A HREF="mailto:')){
if(strstr($email,'Bcc'))
continue;
preg_match_all('/"([^"]+)"/', $email, $m);
$email = trim(strstr($m[1][0],':'),":");
$target = $m[1][1];
fwrite($fp,"$target,$target,$email\n");
}
}
fclose($fp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment