Skip to content

Instantly share code, notes, and snippets.

@AlexKovax
Last active December 18, 2015 01: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 AlexKovax/5705710 to your computer and use it in GitHub Desktop.
Save AlexKovax/5705710 to your computer and use it in GitHub Desktop.
A quick function to extract the name of the contributors from a Kiss Kiss Bank Bank "contributors" page
<?php
//returns an array with the names extracted
function name_extractor($url){
$res=array();
$html = file($url);
foreach($html as $ligne)
if(preg_match("/class\=\"username\"\>(.+)\<\/a\>/",$ligne,$matches))
array_push($res,$matches[1]);
return $res;
}
//usage example
print_r(name_extractor("http://www.kisskissbankbank.com/fr/projects/chiz-magazine-n-2/contributors"));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment