| 1 |
|
<?php |
| 2 |
|
/* |
| 3 |
|
* Created on Apr 6, 2007 |
| 4 |
|
* |
| 5 |
|
* To change the template for this generated file go to |
| 6 |
|
* Window - Preferences - PHPeclipse - PHP - Code Templates |
| 7 |
|
*/ |
| 8 |
|
|
| 9 |
|
function leech_keywords_delicious_engine_info() { |
| 10 |
|
return t('Delicious'); |
| 11 |
|
} |
| 12 |
|
|
| 13 |
|
function leech_keywords_engine_delicious_keywords_engine_api($action, $args = array()) { |
| 14 |
|
switch($action) { |
| 15 |
|
case 'list_engines': |
| 16 |
|
return array('engine_delicious' => t('Delicious search engine.')); |
| 17 |
|
break; |
| 18 |
|
case 'parse_url': |
| 19 |
|
if( isset($args['engines']['engine_delicious']) && $args['engines']['engine_delicious'] != FALSE ) { |
| 20 |
|
return array('engine_delicious' => _delicious_engine_parse_url($args['keywords'])); |
| 21 |
|
} |
| 22 |
|
break; |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
|
| 26 |
|
function _delicious_engine_parse_url ($keywords = ""){ |
| 27 |
|
$keywords = urlencode($keywords); |
| 28 |
|
$url = "http://del.icio.us/rss/tag/$keywords"; |
| 29 |
|
return $url; |
| 30 |
|
} |