You are here

function _emimage_photobucket_scrape_image_title in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emimage/providers/photobucket.inc \_emimage_photobucket_scrape_image_title()

Visit the image URL and scrape the image title from HTML.

Parameters

String $url: Image URL.

Return value

String Image title.

1 call to _emimage_photobucket_scrape_image_title()
emimage_photobucket_image_title in contrib/emimage/providers/photobucket.inc
implement emimage_PROVIDER_image_title

File

contrib/emimage/providers/photobucket.inc, line 124
This include processes photobucket.com image files for use by emfield.module.

Code

function _emimage_photobucket_scrape_image_title($url) {
  static $title;
  if (isset($title[$url])) {
    return $title[$url];
  }
  $rs = drupal_http_request($url);
  $html = $rs->data;
  return $title[$url] = preg_match('@<span id="photoTitle">(.+?)</span>@is', $html, $matches) ? $matches[1] : '';
}