You are here

function _image_ncck_imageshack_scrape_image_url in Embedded Media Field 5

Scrape the actual image URL from the ImageShack page.

Parameters

String $url: ImageShack page.

Return value

String ImageShack image URL.

1 call to _image_ncck_imageshack_scrape_image_url()
image_ncck_imageshack_data in contrib/image_ncck/providers/imageshack.inc

File

contrib/image_ncck/providers/imageshack.inc, line 107

Code

function _image_ncck_imageshack_scrape_image_url($url) {
  static $urls;
  if (isset($urls[$url])) {
    return $urls[$url];
  }
  $html = file_get_contents($url);
  if (preg_match('!<img id="thepic" .+? src="(.+?)"!is', $html, $matches)) {
    return $urls[$url] = $matches[1];
  }
}