You are here

function asset_youtube_call in Asset 5

Same name and namespace in other branches
  1. 6 asset_youtube/asset_youtube.module \asset_youtube_call()
1 call to asset_youtube_call()
asset_youtube_sync in asset_youtube/asset_youtube.module

File

asset_youtube/asset_youtube.module, line 292

Code

function asset_youtube_call($method, $params = array()) {
  global $user;
  $dev_id = variable_get('asset_youtube_dev_id', '');
  $yt_user = $user->asset_youtube['username'];
  $url = 'http://www.youtube.com/api2_xmlrpc';
  $default_params = array(
    'dev_id' => $dev_id,
    'user' => $yt_user,
  );
  $params = array_merge($default_params, $params);
  $xml = xmlrpc($url, $method, $params);
  require_once drupal_get_path('module', 'asset_youtube') . '/xmlparser.class.php';
  $response = new XMLParser($xml);
  $response
    ->Parse();
  return $response;
}