Want more features on Pastebin? Sign Up, it's FREE!

Ego Ticker PHP Score

By: MattRichardson on Jan 16th, 2012  |  syntax: PHP  |  size: 0.31 KB  |  views: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $url = "http://www.reddit.com/user/MattRichardson/about.json";
  3. $str = file_get_contents($url);
  4. $val = json_decode($str);
  5. echo $val->data->link_karma;
  6.  
  7. $myFile = "reddit-" . date("Ymd"). ".txt";
  8. $fh = fopen($myFile, 'w') or die("can't open file");
  9. fwrite($fh, $val->data->link_karma);
  10. fclose($fh);
  11.  
  12. ?>
clone this paste RAW Paste Data