You are here

emapi.parse.inc in Embedded Media Field 6.3

Parsing JSON callback for Embedded Media API.

File

emapi/includes/emapi.parse.inc
View source
<?php

/**
 * @file
 * Parsing JSON callback for Embedded Media API.
 */

/**
 * Callback for /emapi/parse/json.
 */
function emapi_parse_json() {
  $url = $_GET['url'];
  if ($media = emapi_parse($url)) {
    emapi_media_save($media);
    drupal_json(array(
      'status' => TRUE,
      'uri' => $media
        ->get_uri(),
    ));
  }
  else {
    drupal_json(array(
      'status' => FALSE,
    ));
  }
}

Functions

Namesort descending Description
emapi_parse_json Callback for /emapi/parse/json.