so I'm using YQL to get a youtube user's subscriber count.
to do this I'm making a query using a URL like this:
$query = 'https://query.yahooapis.com/v1/public/yql?q='.urlencode("SELECT * FROM xml WHERE url='http://gdata.youtube.com/feeds/api/users/{$id}'").'&format=json&callback=';
then I decode the response and find the array entry I'm looking for like this:
$response = json_decode($response, true);
$subscriber_count = $response['query']['results']['entry']['statistics']['subscriberCount'];
it works fine, except I don't like the way I'm doing this :)
I mean, is there a way I can get the subscriberCount
value directly from the $query
URL above? I don't need the entire XML, just that one entry.