You are here

function emapi_parse_json in Embedded Media Field 6.3

Callback for /emapi/parse/json.

1 string reference to 'emapi_parse_json'
emapi_menu in emapi/emapi.module
Implementation of hook_menu().

File

emapi/includes/emapi.parse.inc, line 11
Parsing JSON callback for Embedded Media API.

Code

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,
    ));
  }
}