[support] retrieving latest page XHTML during update process
    Joe Corneli 
    holtzermann17 at gmail.com
       
    Tue Feb  7 19:45:48 UTC 2012
    
    
  
Hello:
We're trying to grab the page XHTML each time the user presses save.
Unfortunately, when we run cURL within hook_entity_update, we are
getting old values.
Sample code is below.  Can someone suggest how to get the latest page
source, not some cached value, just after the user presses "save"?
Thanks,
Joe
function pyrdfa_entity_update($node){
  if ($node->type=="article"){
    drupal_set_message('pyrdfa_entity_update hook invoked!');
    // Extract RDF metadata
    $ws_endpoint =
"http://www.w3.org/2007/08/pyRdfa/extract?uri="."http://beta.planetmath.org/".$node->uri['path'];
    $returnXML = curl_post($ws_endpoint);
    // this will display OLD metadata
    drupal_set_message('<h2>Returned RDF/XML</h2><pre>'.
htmlspecialchars($returnXML) .'</pre>');
  }
}
    
    
More information about the support
mailing list