This page documents the client-side API used to create the Faves widgets.
JSON, which stands for
JavaScript Object Notation, is a lightweight data-interchange format aimed at easy use in browser-based code, as well as in most desktop or server-side programming environments. In fact, our official browser-based
widget uses the JSON feed under the covers.
The Request
Request Type
| Url
| Description
|
| My Faves | http://faves.com/users/<login>/json | Get your (or another user's) most recent Faves optionally filtered by tags. |
| Friends' Faves | http://faves.com/users/<login>/friends/json | Get your (or another user's) friends' most recent Faves optionally filtered by tags. |
| Everyone's Faves | http://faves.com/json/buzz/<tag1>/<tag2> | Get the recently popular Faves optionally filtered by tags. |
Query Parameters
All parameters are optional.
Name
| Type
| Default Value | Description
|
callback
| String |
| The function that will receive the response. |
count
| Integer | 3 | The maximum number of Faves to return. Note: No more than 2010 Faves will be returned. |
widgetId
| String |
| Use this to specify a CSS id that gets passed back to your callback function. This is useful if you want to use the same callback function to render multiple widgets on a page. |
hideNote
| Boolean | false | If specified and set to true, this will omit "n" from the response. |
hideThumbnail
| Boolean | false | If specified and set to true, this will omit "tIU" from the response. |
hideUser
| Boolean | false | If specified and set to true, this will omit "uN", "uU", and "uiU" from the response. |
| st | String |
| The tags to filter on. Must be of the form: st=tag:"apple" or st=tag:"apple" tag:"microsoft" |
The Response
Name
| Type
| Description
|
| moreCount | Integer | The number of additional Faves (i.e. those not included in the response) satisfying the request. |
| faves | Fave | An array of Faves satisfying the request (see below). |
| widgetId | string | The widgetId that you specified when making the request. |
Fave Return Type Description
Name
| Type
| Description
|
s
| String | The Fave subject, often the title of the referenced page. |
u
| String | The URL of the content the Fave references. |
n
| String | The user's personal note on the Fave. |
tIU
| String | URL containing a thumbnailed image. |
uN
| String | The authoring user's first name. |
uU
| String | The URL for the authoring user's page on Faves. |
uIU
| String | The URL for the authoring user's thumbnailed image. |
Example
Request:<script src='http://faves.com/users/mohit/json?callback=favesWidget.render&widgetId=faves.2008.3.4.13.42.6.55&count=2'></script>
Response: favesWidget.render(
{
widgetId:"faves.2008.3.4.13.42.6.55",
moreCount:3536,
faves:[
{
s:"Starbucks | We\'re doing something big at Starbucks. Like Venti big.",
u:"http://faves.com/users/mohit/dot/113341166932",
n:"In addition to the quoted event, there is a surprise event at the Pike Place Market Starbucks at 6 p.m. on Tuesday, April 8th.\n\nQuoted: We\'re doing something big at Starbucks. Like Venti big. We can\'t tell you what\'s going to happen because that\'ll ruin the surprise. Just come to any U.S. Starbucks on Tuesday, April 8 at noon Eastern / 9 a.m. Pacific, sharp, to celebrate something big.",
tIU:"http://i.faves.com/01/54/4514/3e17eb5e/7750f09648db5f7bca_2.jpg"
...
},
{
s:"Board Café",u:"http://faves.com/users/mohit/dot/113294455066",
n:"This site was highly recommended by the instructors of the SeattleWorks Bridge course.\n\nQuoted: Board Café is the electronic newsletter exclusively for members of nonprofit boards of directors. Short enough to read over a cup of coffee, Board Café offers a menu of ideas, information, opinion, news, and resources to help board members give and get the most out of board service. There are over 90 great issues in the archive!",
tIU:"http://i.faves.com/01/b4/a5e5/13955cea/e5e9f45d0e005f33bd_2.jpg"
...
}]
});