Created
August 25, 2014 22:51
-
-
Save rugbyprof/8ab522319a5d8d0404a8 to your computer and use it in GitHub Desktop.
Create a beginning grade book from a summary list from banner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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