Skip to content

Instantly share code, notes, and snippets.

@fuzzmz
Created March 26, 2012 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuzzmz/225b90f158c41d690606 to your computer and use it in GitHub Desktop.
Save fuzzmz/225b90f158c41d690606 to your computer and use it in GitHub Desktop.
My Little Pony: Friendship is Magic as code
<?php
$friendship=$magic;
function learned($start,$end){
$msg='';
$lesson=mysql_query("SELECT story, friendsid, about, date, plot FROM friendship INNER JOIN ponies ON ponies.id = friendship.friendsid WHERE friendship.about IS NOT NULL AND date>'$start' AND date<'$end' LIMIT 1");
while ($episode = mysql_fetch_assoc($lesson)){
$msg.=$episode['plot']."rn";
}
return $msg;
}
$greeting = "Dear Princess Celestia,rnrn";
$signature="rnrnYour Faithful Student,rnTwilight Sparkle";
$to = 'celestia@equestria.gov';
$subject = 'Daily report: '.date("m.d.y");
$headers = 'From: twi@ponyvile.edu' . "rn" .
'Reply-To: spike@twilightslibrary.com' . "rn" .
'X-Mailer: PHP/' . phpversion();
$message=$greeting.learned(time()-86400,time()).$signature;
mail($to, $subject, $message, $headers);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment