Service/Delicious.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service
- Subpackage
- Delicious
- Version
- $Id: Delicious.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Service_Delicious
Zend_Service_Delicious is a concrete implementation of the del.icio.us web service
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
Methods

__construct(string $uname = null, string $pass = null) : voidConstructs a new del.icio.us Web Services Client
| Name | Type | Description |
|---|---|---|
| $uname | string | Client username |
| $pass | string | Client password |

_evalXmlResult(\DOMDocument $response) : voidEvaluates XML response
| Name | Type | Description |
|---|---|---|
| $response | \DOMDocument |
| Exception | Description |
|---|---|
| \Zend_Service_Delicious_Exception |

_parseXmlPostList(\DOMDocument $response) : \Zend_Service_Delicious_PostListConstructs Zend_Service_Delicious_PostList from XML response
| Name | Type | Description |
|---|---|---|
| $response | \DOMDocument |
| Type | Description |
|---|---|
| \Zend_Service_Delicious_PostList |
| Exception | Description |
|---|---|
| \Zend_Service_Delicious_Exception |

_xmlResponseToArray(\DOMDocument $response, string $root, string $child, string $attKey, string $attValue) : arrayTransform XML string to array
| Name | Type | Description |
|---|---|---|
| $response | \DOMDocument | |
| $root | string | Name of root tag |
| $child | string | Name of children tags |
| $attKey | string | Attribute of child tag to be used as a key |
| $attValue | string | Attribute of child tag to be used as a value |
| Type | Description |
|---|---|
| array |
| Exception | Description |
|---|---|
| \Zend_Service_Delicious_Exception |

addBundle(string $bundle, array $tags) : \Zend_Service_DeliciousAdds a new bundle
| Name | Type | Description |
|---|---|---|
| $bundle | string | Name of new bundle |
| $tags | array | Array of tags |
| Type | Description |
|---|---|
| \Zend_Service_Delicious | Provides a fluent interface |

createNewPost( $title, $url) : \Zend_Service_Delicious_PostCreate new post
| Name | Type | Description |
|---|---|---|
| $title | ||
| $url |
| Type | Description |
|---|---|
| \Zend_Service_Delicious_Post |

deleteBundle(string $bundle) : \Zend_Service_DeliciousDelete a bundle
| Name | Type | Description |
|---|---|---|
| $bundle | string | Name of bundle to be deleted |
| Type | Description |
|---|---|
| \Zend_Service_Delicious | Provides a fluent interface |

deletePost(string $url) : \Zend_Service_DeliciousDelete a post
| Name | Type | Description |
|---|---|---|
| $url | string | URL of post to be deleted |
| Type | Description |
|---|---|
| \Zend_Service_Delicious | Provides a fluent interface |

getAllPosts(string $tag = null) : \Zend_Service_Delicious_PostListGet all posts
| Name | Type | Description |
|---|---|---|
| $tag | string | Optional filtering by tag |
| Type | Description |
|---|---|
| \Zend_Service_Delicious_PostList |

getBundles() : arrayGet all bundles, returning an array with bundles as keys and array of tags as values
| Type | Description |
|---|---|
| array | list of bundles |

getDates(string $tag = null) : arrayGet number of posts by date
Returns array where keys are dates and values are numbers of posts
| Name | Type | Description |
|---|---|---|
| $tag | string | Optional filtering by tag |
| Type | Description |
|---|---|
| array | list of dates |

getLastUpdate() : \Zend_DateGet time of the last update
| Type | Description |
|---|---|
| \Zend_Date |
| Exception | Description |
|---|---|
| \Zend_Service_Delicious_Exception |

getPosts(string $tag = null, \Zend_Date $dt = null, string $url = null) : \Zend_Service_Delicious_PostListGet posts matching the arguments
If no date or url is given, most recent date will be used
| Name | Type | Description |
|---|---|---|
| $tag | string | Optional filtering by tag |
| $dt | \Zend_Date | Optional filtering by date |
| $url | string | Optional filtering by url |
| Type | Description |
|---|---|
| \Zend_Service_Delicious_PostList |
| Exception | Description |
|---|---|
| \Zend_Service_Delicious_Exception |

getRecentPosts(string $tag = null, string $count = 15) : \Zend_Service_Delicious_PostListGet recent posts
| Name | Type | Description |
|---|---|---|
| $tag | string | Optional filtering by tag |
| $count | string | Maximum number of posts to be returned (default 15) |
| Type | Description |
|---|---|
| \Zend_Service_Delicious_PostList |

getTags() : arrayGet all tags, returning an array with tags as keys and number of corresponding posts as values
| Type | Description |
|---|---|
| array | list of tags |

getUrlDetails(string $url) : arrayGet details on a particular bookmarked URL
Returned array contains four elements: - hash - md5 hash of URL - top_tags - array of tags and their respective usage counts - url - URL for which details were returned - total_posts - number of users that have bookmarked URL
If URL hasen't been bookmarked null is returned.
| Name | Type | Description |
|---|---|---|
| $url | string | URL for which to get details |
| Type | Description |
|---|---|
| array |

getUserFans(string $user) : arrayGet fans of a user
| Name | Type | Description |
|---|---|---|
| $user | string | Owner of the fans |
| Type | Description |
|---|---|
| array |

getUserNetwork(string $user) : arrayGet network of a user
| Name | Type | Description |
|---|---|---|
| $user | string | Owner of the network |
| Type | Description |
|---|---|
| array |

getUserPosts(string $user, int $count = null, string $tag = null) : \Zend_Service_Delicious_PostListGet posts of a user
| Name | Type | Description |
|---|---|---|
| $user | string | Owner of the posts |
| $count | int | Number of posts (default 15, max. 100) |
| $tag | string | Optional filtering by tag |
| Type | Description |
|---|---|
| \Zend_Service_Delicious_PostList |

getUserTags(string $user, int $atleast = null, int $count = null, string $sort = 'alpha') : arrayGet tags of a user
Returned array has tags as keys and number of posts as values
| Name | Type | Description |
|---|---|---|
| $user | string | Owner of the posts |
| $atleast | int | Include only tags for which there are at least ### number of posts |
| $count | int | Number of tags to get (default all) |
| $sort | string | Order of returned tags ('alpha' || 'count') |
| Type | Description |
|---|---|
| array |

makeRequest(string $path, array $parms = array(), string $type = 'xml') : mixedHandles all GET requests to a web service
| Name | Type | Description |
|---|---|---|
| $path | string | Path |
| $parms | array | Array of GET parameters |
| $type | string | Type of a request ("xml"|"json") |
| Type | Description |
|---|---|
| mixed | decoded response from web service |
| Exception | Description |
|---|---|
| \Zend_Service_Delicious_Exception |

renameTag(string $old, string $new) : \Zend_Service_DeliciousRename a tag
| Name | Type | Description |
|---|---|---|
| $old | string | Old tag name |
| $new | string | New tag name |
| Type | Description |
|---|---|
| \Zend_Service_Delicious | Provides a fluent interface |

setAuth(string $uname, string $pass) : \Zend_Service_DeliciousSet client username and password
| Name | Type | Description |
|---|---|---|
| $uname | string | Client user name |
| $pass | string | Client password |
| Type | Description |
|---|---|
| \Zend_Service_Delicious | Provides a fluent interface |