| 1 |
<?php |
<?php |
| 2 |
// $Id: autotagging_tagthenet.module,v 1.2 2009/07/01 21:15:54 acstewart Exp $ |
// $Id: autotagging_tagthenet.module,v 1.3 2009/07/07 21:25:07 acstewart Exp $ |
| 3 |
|
|
| 4 |
/* |
/* |
| 5 |
* @file autotagging_tagthenet.module |
* @file autotagging_tagthenet.module |
| 23 |
$url = AUTOTAGGING_TAGTHENET_URL; |
$url = AUTOTAGGING_TAGTHENET_URL; |
| 24 |
$data = 'text='. urlencode($text); |
$data = 'text='. urlencode($text); |
| 25 |
$response = drupal_http_request($url .'?'. $data, array(), 'POST'); |
$response = drupal_http_request($url .'?'. $data, array(), 'POST'); |
| 26 |
|
if ($response->code != 200) { |
| 27 |
|
watchdog('autotagging_tagthenet', 'Received response code '. $response->code .' from Tagthe.net', WATCHDOG_SEVERE); |
| 28 |
|
return array(); |
| 29 |
|
} |
| 30 |
$xml = $response->data; |
$xml = $response->data; |
| 31 |
$dom = DOMDocument::loadXML($xml); |
$dom = DOMDocument::loadXML($xml); |
| 32 |
$xp = new DOMXPath($dom); |
$xp = new DOMXPath($dom); |