| 1 |
<?php |
<?php |
| 2 |
// $Id: autotagging_yahoo_terms.module,v 1.3 2009/07/22 18:24:08 acstewart Exp $ |
// $Id: autotagging_yahoo_terms.module,v 1.4 2009/07/24 17:30:25 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. |
| 21 |
function autotagging_yahoo_terms_autotagging_api_insert(&$node, &$text) { |
function autotagging_yahoo_terms_autotagging_api_insert(&$node, &$text) { |
| 22 |
$url = AUTOTAGGING_YAHOO_TERMS_URL; |
$url = AUTOTAGGING_YAHOO_TERMS_URL; |
| 23 |
$appid = variable_get('autotagging_yahoo_terms_appid', ''); |
$appid = variable_get('autotagging_yahoo_terms_appid', ''); |
| 24 |
$url .= '?appid=' . $appid; |
$url .= '?appid='. $appid; |
| 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) { |
if ($response->code != 200) { |
| 29 |
watchdog('autotagging_yahoo_terms', 'Received response code '. $response->code .' from Yahoo Terms', WATCHDOG_SEVERE); |
watchdog('autotagging_yahoo_terms', 'Received response code '. $response->code .' from Yahoo Terms', WATCHDOG_SEVERE); |
| 30 |
return array(); |
return array(); |