Digg API update for April 2012

293 views
Skip to first unread message

Dave Beckett

unread,
Apr 2, 2012, 4:08:37 PM4/2/12
to Digg API Developers Support
It's April 2 so this is not a joke :)

I'm happy to announce we've released 4 new API calls and a minor
change.

These have all been added after user requests either to this list or
to @diggapi on Twitter.

1. story.unhide - un-bury (hide) a story
http://developers.digg.com/version2/story-unhide

2. story.undigg - un-digg a story
http://developers.digg.com/version2/story-undigg

3. user.getFollowers - get users that follow a user
http://developers.digg.com/version2/user-getfollowers

4. user.getFollowing - get users that are being followed by a user
http://developers.digg.com/version2/user-getfollowing

The last two calls replace functionality that the V1 API provided in a
broken way (/user/USER/friends). I'll just mention again that no V1
API call is supported and we could turn them off at any time.

The paging in these calls uses the standard Digg API 'cursor' model:
if you get a response back with a JSON key 'cursor' / XML element
<cursor> and a non-empty VALUE, then pass that as a query argument to
the same call like &cursor=VALUE and you will get the next page of
values. For example the request to get the newest followers of Kevin
Rose:

http://services.digg.com/2.0/user.getFollowers?username=kevinrose

returns a JSON response at this time with the line:

"cursor": "20120325040743:e2bd7a8deb894ef8811846224fa2764a",

so your next call should be:

http://services.digg.com/2.0/user.getFollowers?username=kevinrose&cursor=20120325040743%3Ae2bd7a8deb894ef8811846224fa2764a


In the minor fixes department:

* return the media type for stories in all API call responses

So you can distinguish a news story, video or image by looking for
the 'media_type' key/XML element.

Cheers

Dave
Reply all
Reply to author
Forward
0 new messages