forked from remi/pubwich
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mod] update Delicious service class
- add Service method to get config values for config keys - adjust standard content of a Delicious service item - using new Feed service as Delicious parent service
- Loading branch information
Showing
3 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,43 @@ | ||
<?php | ||
defined('PUBWICH') or die('No direct access allowed.'); | ||
defined('PUBWICH') or die('No direct access allowed.'); | ||
|
||
/** | ||
* @classname Delicious | ||
* @description Fetch Del.icio.us bookmarks | ||
* @version 1.1 (20090929) | ||
* @author Rémi Prévost (exomel.com) | ||
* @methods None | ||
*/ | ||
/** | ||
* Delicious Service | ||
* | ||
* Fetch Delicious bookmarks. | ||
* | ||
* @version 1.1 (20090929) | ||
* @author Rémi Prévost (exomel.com) | ||
* @author Michael Haschke, http://michael.haschke.biz/ | ||
* @methods None | ||
*/ | ||
|
||
Pubwich::requireServiceFile( 'RSS' ); | ||
class Delicious extends RSS { | ||
Pubwich::requireServiceFile( 'Feed' ); | ||
class Delicious extends Feed { | ||
|
||
public function __construct( $config ){ | ||
$config['link'] = 'http://del.icio.us/'.$config['username'].'/'; | ||
$config['url'] = sprintf( 'http://feeds.delicious.com/v2/rss/%s?count=%s', $config['username'], $config['total'] ); | ||
parent::__construct( $config ); | ||
$this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a></li>'."\n"); | ||
} | ||
public function __construct( $config ){ | ||
$config['link'] = 'http://delicious.com/'.$config['username'].'/'; | ||
$config['url'] = sprintf( 'http://feeds.delicious.com/v2/rss/%s?count=%s', $config['username'], $config['total'] ); | ||
parent::__construct( $config ); | ||
$this->setItemTemplate( | ||
'<li> | ||
<a href="{{{link}}}">{{{title}}}</a> | ||
({{{date}}}) | ||
{{#category}} | ||
<em><a href="{{{service_link}}}{{{category}}}">{{{category}}}</a></em> | ||
{{/category}} | ||
</li>'."\n" | ||
); | ||
} | ||
|
||
} | ||
/** | ||
* @return array | ||
* @since 20110531 | ||
*/ | ||
public function processDataItem( $item ) { | ||
$item = parent::processDataItem($item); | ||
$item['service_link'] = $this->getConfigValue('link'); | ||
return $item; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters