Skip to content

Instantly share code, notes, and snippets.

@recyclerobot
Last active August 29, 2015 13:56
Show Gist options
  • Save recyclerobot/9278766 to your computer and use it in GitHub Desktop.
Save recyclerobot/9278766 to your computer and use it in GitHub Desktop.
execute phantom script and write to txt file
<?php
$o = exec('./phantomjs get_twitter_followers.js weworkweplay');
$j = json_decode($o, true);
$fp = fopen('twitter_followers.txt', 'w');
fwrite($fp, $j["weworkweplay"]);
fclose($fp);
echo $o;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment