You are here

function biblio_import_from_url in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 includes/biblio.import.export.inc \biblio_import_from_url()
  2. 6 biblio.import.export.inc \biblio_import_from_url()
  3. 7 includes/biblio.import.export.inc \biblio_import_from_url()

File

includes/biblio.import.export.inc, line 418
Functions that are used to import and export biblio data.

Code

function biblio_import_from_url($URL) {
  $handle = fopen($URL, "r");

  // fetch data from URL in read mode
  $data = "";
  if ($handle) {
    while (!feof($handle)) {
      $data .= fread($handle, 4096);

      // read data in chunks
    }
    fclose($handle);
  }
  else {
    $errorMessage = t("Error occurred: Failed to open %url", array(
      '%url',
      $URL,
    ));

    // network error
    drupal_set_message($errorMessage, 'error');
  }
  return $data;
}