Skip to content

Instantly share code, notes, and snippets.

@bendechrai
Last active August 29, 2015 14:06
Show Gist options
  • Save bendechrai/988089826697a0aebe57 to your computer and use it in GitHub Desktop.
Save bendechrai/988089826697a0aebe57 to your computer and use it in GitHub Desktop.
Meetup random attendee selector
<?php
$ug = 'Melbourne-PHP-Users-Group'; // Usergroup slug
$eid = '202990892'; // Event ID
$html = file_get_contents("http://www.meetup.com/$ug/events/$eid/");
preg_match_all("#<a href=\"http://www.meetup.com/$ug/members/[0-9]*\">([^<]*)</a>#", $html, $array);
$names = $array[1];
$winner = array_rand( array_unique( $names ));
echo $names[$winner] . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment