WebFav - Favoriten und Bookmarks

API - Application Programming Interface

Authentication: alle API Anfragen benötigen HTTP Basic Auth (Login) - Beispiel (PHP)



posts (Bookmarks)

  posts/all fetch all bookmarks by date or index range
  posts/add add a new bookmark
  posts/delete delete an existing bookmark
  posts/get get bookmark for a single date, or fetch specific items
  posts/recent fetch recent bookmarks
  posts/dates list dates on which bookmarks were posted
  posts/update check to see when a user last posted an item

tags (Keywords)

  tags/get fetch all tags
  tags/rename rename a tag on all posts






get all bookmarks (by tag/date)

   (optional) Filter by this tag.

   (optional) Start returning posts this many results into the set.

   (optional) Return this many results.

   (optional) Filter for posts on this date or later

   (optional) Filter for posts on this date or earlier

   (optional) Include change detection signatures on each item



Add a post (bookmark)

   (required) the url of the item.

   (required) the description of the item.

   (optional) notes for the item.

   (optional) tags for the item (comma delimited).

   (optional) datestamp of the item (format "CCYY-MM-DDThh:mm:ssZ").
   Requires a LITERAL "T" and "Z" like in ISO8601 example: "1984-09-01T14:21:31Z"

   (optional) don't replace post if given url has already been posted.

   (optional) make the item public or private



Delete a post (bookmark)

   (required) the url of the item.



Returns one or more posts (bookmarks) on a single day matching the arguments.
If no date or url is given, most recent date will be used.

   (optional) Filter by this tag.

   (optional) Filter by this date, defaults to the most recent date on which bookmarks were saved.

(optional) Fetch a bookmark for this URL, regardless of date.
   Note: Be sure to URL-encode the argument value.

   (optional) Fetch multiple bookmarks by one or more URL MD5s regardless of date,
   separated by URL-encoded spaces (ie. '+').

   (optional) Include change detection signatures on each item in a 'meta' attribute.



Returns a list of the most recent posts (bookmarks) , filtered by argument. Maximum 100.

   (optional) Filter by this tag.

   (optional) Number of items to retrieve (Default:15, Maximum:100).



Returns a list of dates with the number of posts (bookmarks) at each date.

   (optional) Filter by this tag



Returns the last update time for the user, as well as the number of new items in the user's inbox since it was last visited




Returns a list of tags and number of times used by a user.




Rename an existing tag with a new tag name.

   (required) Tag to rename.

   (required) New tag name.




Beispiel / PHP

(Example: posts/all API Request)

<?php // ---------------------------------------------- $username = 'YourUsername'; $passwort = 'YourPassword'; // ---- set the scuttle service url ---- $bservice = 'http://webfav.12hp.de/'; $bservice = rtrim($bservice, '/');
$bservice = str_replace('http://','',$bservice); // ---- choose one of the methods ---- $b_method = 'posts/all'; // ---- build the GET url ---- $serviceurl = 'http://'.$username.':'.$passwort.'@'.$bservice.'/api/'.$b_method.''; $searchtag = ''; // ---- search for a tag or leave blank ---- $res_limit = '10'; // ---- results limit (= maximum items) ---- // ---- set the parameter for the method call ---- $parameter = '?tag='.$searchtag.'&results='.$res_limit.'&meta=yes'; // ---- build the GET url with parameter ---- $apigeturl = $serviceurl.$parameter; // ---------------------------------------------- // ------------- Result XML String -------------- /* ------ $res_str = file_get_contents($apigeturl); $res_nfo = htmlentities($res_str); print "<br />\n"; print "<br />\n"; print "<pre>\n"; print_r($res_nfo); print "</pre>\n"; ------ */ // ---------------------------------------------- // ------------- Result PHP Object -------------- $res_obj = simplexml_load_file($apigeturl); print "<br />\n"; print "<br />\n"; print "<pre>\n"; print_r($res_obj); print "</pre>\n"; // ---------------------------------------------- ?>



... mehr Infos zur API siehe auch: delicious.com/developers


nach oben
(auf dieser Seite)