favmark - Favoriten und Bookmarks

API - Application Programming Interface

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

 

Methoden

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

 

 

Parameter

 

posts/all

get all bookmarks (by tag/date)

&tag={TAG}
   (optional) Filter by this tag.

&start={xx}
   (optional) Start returning posts this many results into the set.

&results={xx}
   (optional) Return this many results.

&fromdt={CCYY-MM-DDThh:mm:ssZ}
   (optional) Filter for posts on this date or later

&todt={CCYY-MM-DDThh:mm:ssZ}
   (optional) Filter for posts on this date or earlier

&meta=yes
   (optional) Include change detection signatures on each item

 

posts/add

Add a post (bookmark)

&url={URL}
   (required) the url of the item.

&description={...}
   (required) the description of the item.

&extended={...}
   (optional) notes for the item.

&tags={...}
   (optional) tags for the item (comma delimited).

&dt={CCYY-MM-DDThh:mm:ssZ}
   (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"

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

&shared=yes
   (optional) make the item public or private

 

posts/delete

Delete a post (bookmark)

&url={URL}
   (required) the url of the item.

 

posts/get

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.

&tag={TAG}+{TAG}+...+{TAG}
   (optional) Filter by this tag.

&dt={CCYY-MM-DDThh:mm:ssZ}
   (optional) Filter by this date, defaults to the most recent date on which bookmarks were saved.

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

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

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

 

posts/recent

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

&tag={TAG}
   (optional) Filter by this tag.

&count={1..100}
   (optional) Number of items to retrieve (Default:15, Maximum:100).

 

posts/dates

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

&tag={TAG}
   (optional) Filter by this tag

 

posts/update

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

<none>

 

tags/get

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

<none>

 

tags/rename

Rename an existing tag with a new tag name.

&old={TAG}
   (required) Tag to rename.

&new={TAG}
   (required) New tag name.

 

 

 

Beispiel / PHP

(Example: posts/all API Request)

<?php // ---------------------------------------------- $username = 'YourUsername'; $passwort = 'YourPassword'; // ---- set the scuttle service url ---- $bservice = 'http://freecontent.12hp.de/bookmark//'; $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

 

zurück
nach oben
(auf dieser Seite)