Hello,

We currently have a cron task on our site that insert the latest videos of Dailymotion automatically in Atom on the site.

I would like to change this to do it with Youtube. How is it possible to automatically import the latest videos on Youtube with Scald?

Or maybe we should use a different system than Scald?

Thank you in advance.
Cordially.

Vincent LEVEQUE

Comments

vince42 created an issue.

vince42’s picture

Nobody has any idea to do this?
How is it possible to automatically have videos from our youtube channel that add up on Drupal?

For example, in the scald_dailymotion module, there is this function:

/**
 * Implements hook_cron().
 */
function scald_dailymotion_cron() {
  $imports = variable_get('scald_dailymotion_imports', array());
  $status = variable_get('scald_dailymotion_imports_status', array());
  foreach ($imports as $import) {
    $items = array();
    $key = $import['type'] . ':' . $import['value'];
    $last_import = isset($status[$key]) ? $status[$key] : 0;
    $all = !empty($import['options']['all']);

    $params = array(
      'fields' => _scald_dailymotion_api_fields(),
      'limit' => SCALD_DAILYMOTION_MAX_ITEMS,
      'created_after' => $last_import,
      'sort' => $all ? 'old' : 'recent',
    );

    switch ($import['type']) {
      case 'user':
        $method = 'user/' . $import['value'] . '/videos';
        break;
      case 'tag':
        $method = 'videos';
        $params['tags'] = $import['value'];
        break;
    }

    $data = _scald_dailymotion_api_call($method, $params);
    if ($data && $data->list) {
      $items = $data->list;
      $status[$key] = $items[$all ? count($items) - 1 : 0]->created_time;
      variable_set('scald_dailymotion_imports_status', $status);
    }

    if ($items) {
      foreach ($items as $item) {
        scald_dailymotion_direct_import($item);
      }
    }
  }
}

Is it possible to create a similar function for youtube to create Atom videos youtube? Or another solution?

Thank you