| 1 |
<?php |
<?php |
| 2 |
// $Id: autotagging_yahoo_terms.module,v 1.1 2009/07/03 01:11:59 acstewart Exp $ |
// $Id: autotagging_yahoo_terms.module,v 1.2 2009/07/06 20:12:56 acstewart Exp $ |
| 3 |
/* |
/* |
| 4 |
* @file autotagging_yahoo_terms.module |
* @file autotagging_yahoo_terms.module |
| 5 |
* Yahoo Terms support for autotagging module. |
* Yahoo Terms support for autotagging module. |
| 25 |
if ($appid != '') { |
if ($appid != '') { |
| 26 |
$data = 'context=' . urlencode($text); |
$data = 'context=' . urlencode($text); |
| 27 |
$response = drupal_http_request($url . '&' . $data, array(), 'POST'); |
$response = drupal_http_request($url . '&' . $data, array(), 'POST'); |
| 28 |
|
if ($response->code != 200) { |
| 29 |
|
watchdog('autotagging_yahoo_terms', 'Received response code '. $response->code .' from Yahoo Terms', WATCHDOG_SEVERE); |
| 30 |
|
return array(); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
$xml = $response->data; |
$xml = $response->data; |
| 34 |
$dom = DOMDocument::loadXML($xml); |
$dom = DOMDocument::loadXML($xml); |
| 35 |
$xp = new DOMXPath($dom); |
$xp = new DOMXPath($dom); |