Skip to content

Instantly share code, notes, and snippets.

@maximevalette
Created December 30, 2013 15:43
Show Gist options
  • Save maximevalette/8183614 to your computer and use it in GitHub Desktop.
Save maximevalette/8183614 to your computer and use it in GitHub Desktop.
Extract FeedPress subscribers count from JSON file
<?php
function get_feedpress_subscribers($url) {
$json_string =file_get_contents($url);
$json = json_decode($json_string, true);
return ( intval( $json['graph']['datasequences'][0]['datapoints'][0]['value'] ) + intval( $json['graph']['datasequences'][1]['datapoints'][0]['value'] ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment