Click to See Complete Forum and Search --> : Happy Birthday, Jebster!!!


dalecosp
09-24-2004, 03:14 AM
/me lights several candles to ward off chilly Canadian nights ... umm, but where's the cake?

bubblenut
09-24-2004, 04:42 AM
Happy birthday jebster :D

http://img59.exs.cx/img59/3618/cube.jpg

piersk
09-24-2004, 10:13 AM
Happy Birthday!!!

Tis also my little sister's b'day today too. She is gonna be 19 tho.

Now I feel REALLY old:glare:

Oh, dale... have you actually written a script that tells you when someone's b'day is? If so, can we see it please?

dalecosp
09-24-2004, 11:16 AM
Well, it's Lord Shryku's script, actually. I forget which thread we were in, and I've looked at 3 or 4 via the search page and not found it. He was apparently rather bored ... I was harping about how I should write a script; he actually did it.

I hacked it up a bit, it sends me a daily e-mail as to whether or not anyone's having a birthday. And, of course, scheduled it with cron and created an array of people to watch for ... it's edited to three here for brevity. (I thought the proxy support was nice, too, LordS, tho' I don't need it...)<?php

// by Lord Shryku, from PHPBuilder. Notification of birthdays....

// Look for the following people's birthdays....
$watch = array('buzzly', 'elizabeth', 'planetsim');

// Email notification address. Set to FALSE for no mail...
$mailto="foo@foo.com";

$proxy = ''; # Proxy Server. Leave blank if you don't use $
$port = ''; # Proxy Port. Leave blank if you don't use a $

$found = array();
$page = 'http://phpbuilder.com/board/index.php';

if(empty($proxy) || empty($port)) {
$page = file_get_contents($page);

} else {
$data = fsockopen($proxy, $proxy);
if(!$data) {
echo "Cannot access ".$page;
}
else {
fputs($data, "GET $page HTTP/1.0\n\n");
$cont = '';
while(!feof($data)) {
$cont .= fread($data, 4096);
}
}
@fclose($data);
$page = substr($cont, strpos($cont, "\r\n\r\n") + 4);
}

$page = strstr($page, 'Birthdays:');
if(($end = strpos($page, '</td>')) !== false)
$page = substr($page, 0, $end);

if(!empty($page)) {
$users = explode("</a>", $page);
foreach($users as $u) {
if(eregi('userid=[0-9]', $u)) {
$found[] = trim(str_replace('>', '', substr($u, strrpos($u, '>'))));
}
}
}

if(count($found) > 0) {
$matches = array_intersect($watch, $found);
if(count($matches) > 0) {
$label = (count($matches) > 1) ? ' have birthdays' : ' has a birthday';
$label .= ' today!';
$msg="Your PHPBuilder friend(s), ".implode(', ', $matches).$label;
}
else {
$msg= 'No PHPBuilder friend birthdays today.';
}
}
else {
$msg= 'This script sucks. Could not find the birthdays';
}

if ($mailto) {
$success=mail($mailto, "PHPBuilder Birthday Watch", $msg);
} else {
echo $label;
}

?>So, in my email this morning:

Your PHPBuilder friend, jebster, has a birthday today!

Elizabeth
09-24-2004, 12:10 PM
Jebster - I neglected to tell you earlier, so I will tell you now-

Happy Birthday! :)

LordShryku
09-24-2004, 12:14 PM
Boredom kills eh? :D

I need the proxy support here because of the firewall at work. So it's usually an include from my network functions file, but I figured someone else here might have some use for it too. I'm just suprised the script works and that no regexp people have complained yet. :D


And happy BDay Jebster http://www.roempire.com/forums/images/smilies/moresmilies/thumbsup.gif

dalecosp
09-24-2004, 01:04 PM
Now, bubblenut, about that cake ....

I'm too old I guess .. Xbox? PS/2?

How in the world did they make that cable?

goldbug
09-24-2004, 02:17 PM
Originally posted by dalecosp
Now, bubblenut, about that cake ....

I'm too old I guess .. Xbox? PS/2?

How in the world did they make that cable?

Tis a delicious looking GameCube. :)

jebster
09-24-2004, 04:34 PM
Thanks everyone :) Cake looks good, mmmm....

drawmack
09-24-2004, 07:24 PM
happy b-day man