Package Data | |
---|---|
Maintainer Username: | tr0n |
Maintainer Contact: | hell@tonioriol.com (Toni Oriol) |
Package Create Date: | 2015-01-19 |
Package Last Update: | 2015-01-19 |
Home Page: | |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-04-25 15:15:42 |
Package Statistics | |
---|---|
Total Downloads: | 13 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
This is a Laravel package that wraps all the Delicious API methods.
Require this package with composer using the following command:
composer require tr0n/laravelicious
.
First, you need to add the auth params in the config, to do this you will need to publish the config file first. Use the following command:
php artisan config:publish tr0n/laravelicious
After that, a config file named general.php
is generated inside the /app/config/packages/tr0n/laravelicious/
folder. Add the user and password parameters inside this file.
All the available Delicious API calls are mapped.
For example:
Laravelicious::add()
Add a new post to Delicious.
Type | Name | Description ------|------|------------- array | $params (see below) | string | $params['url'] | The url of the item (required). string | $params['description'] | The description of the item (required). string | $params['extended'] | Notes for the item. array | $params['tags'] | Tags for the item. string | $params['dt'] | Datestamp of the item (format “CCYY-MM-DDThh:mm:ssZ”). Requires a LITERAL “T” and “Z” like in ISO8601 at http://www.cl.cam.ac.uk/~mgk25/iso-time.html for Example: 1984-09-01T14:21:31Z. bool | $params['replace'] | Don’t replace post if given url has already been posted (Default to false). bool | $params['shared'] | Make the item private (Default to true).
An associative array With 'success'
, 'message'
and 'url'
keys.
All the methods follow the same structure. The arguments are passed as array, depending on the method some are optional and some required, this way we are able to pass more flexibly the arguments that we want.
Same for returning values. All methods returns an array with a field 'success'
with true
on success and false
on failure, a 'message'
field parsed from the xml response (if not exists on the delicious.com response, the field will go empty).
When there are trouble connecting to delicious.com, a DeliciousConnectionException will be thrown with some details about the attempts, the url and a message.