Try PBworks for yourself
View
 

ListEvents

Page history last edited by Jeff Hodsdon 2 years, 5 months ago

This API is deprecated, and will be going away in the future.  Please see the documentation for the new API here.

 

List Events

 


 

Fetches a list of diggs or comments from Digg.

 

Example Request

 

Retrieve some diggs from user kevinrose:

 

 

http://services.digg.com/user/kevinrose/diggs?min_date=1176760800&appkey=http%3A%2F%2Fapidoc.digg.com  

 

Example Responses

 

XML

 

 

<?xml version="1.0" encoding="utf-8" ?>
<events timestamp="1176998174" min_date="1176760800" total="19" offset="0" count="10">
 <digg date="1176935035" story="1776206" id="65657478" user="kevinrose" status="upcoming" />
 <digg date="1176917530" story="1797248" id="65602282" user="kevinrose" status="upcoming" />
 <digg date="1176917246" story="1795682" id="65601396" user="kevinrose" status="popular" />
 <digg date="1176877849" story="1786809" id="65528931" user="kevinrose" status="popular" />
 <digg date="1176877580" story="1790457" id="65528556" user="kevinrose" status="popular" />
 <digg date="1176877472" story="1794432" id="65528395" user="kevinrose" status="popular" />
 <digg date="1176857787" story="1792060" id="65485850" user="kevinrose" status="popular" />
 <digg date="1176850782" story="1781720" id="65468359" user="kevinrose" status="popular" />
 <digg date="1176848403" story="1780680" id="65461429" user="kevinrose" status="popular" />
 <digg date="1176847067" story="1789199" id="65457469" user="kevinrose" status="upcoming" />
</events>

 

JSON

 

 

{
        "timestamp" : 1176998180,
        "min_date" : 1176760800,
        "total" : "19",
        "offset" : 0,
        "diggs" : [
                {
                        "date" : 1176935035,
                        "story" : 1776206,
                        "id" : 65657478,
                        "user" : "kevinrose",
                        "status" : "upcoming"
                },
                {
                        "date" : 1176917530,
                        "story" : 1797248,
                        "id" : 65602282,
                        "user" : "kevinrose",
                        "status" : "upcoming"
                },
                {
                        "date" : 1176917246,
                        "story" : 1795682,
                        "id" : 65601396,
                        "user" : "kevinrose",
                        "status" : "popular"
                },
                {
                        "date" : 1176877849,
                        "story" : 1786809,
                        "id" : 65528931,
                        "user" : "kevinrose",
                        "status" : "popular"
                },
                {
                        "date" : 1176877580,
                        "story" : 1790457,
                        "id" : 65528556,
                        "user" : "kevinrose",
                        "status" : "popular"
                },
                {
                        "date" : 1176877472,
                        "story" : 1794432,
                        "id" : 65528395,
                        "user" : "kevinrose",
                        "status" : "popular"
                },
                {
                        "date" : 1176857787,
                        "story" : 1792060,
                        "id" : 65485850,
                        "user" : "kevinrose",
                        "status" : "popular"
                },
                {
                        "date" : 1176850782,
                        "story" : 1781720,
                        "id" : 65468359,
                        "user" : "kevinrose",
                        "status" : "popular"
                },
                {
                        "date" : 1176848403,
                        "story" : 1780680,
                        "id" : 65461429,
                        "user" : "kevinrose",
                        "status" : "popular"
                },
                {
                        "date" : 1176847067,
                        "story" : 1789199,
                        "id" : 65457469,
                        "user" : "kevinrose",
                        "status" : "upcoming"
                }
        ],
        "count" : 10
}

 

PHP

 

 

O:13:"DiggAPIEvents":6:{s:9:"timestamp";i:1176998185;s:8:"min_date";i:1176760800;s:5:"total";s:2:"19";s:6:"offset";i:0;s:5:"diggs";a:10:{i:0;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176935035;s:5:"story";i:1776206;s:2:"id";i:65657478;s:4:"user";s:9:"kevinrose";s:6:"status";s:8:"upcoming";}i:1;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176917530;s:5:"story";i:1797248;s:2:"id";i:65602282;s:4:"user";s:9:"kevinrose";s:6:"status";s:8:"upcoming";}i:2;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176917246;s:5:"story";i:1795682;s:2:"id";i:65601396;s:4:"user";s:9:"kevinrose";s:6:"status";s:7:"popular";}i:3;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176877849;s:5:"story";i:1786809;s:2:"id";i:65528931;s:4:"user";s:9:"kevinrose";s:6:"status";s:7:"popular";}i:4;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176877580;s:5:"story";i:1790457;s:2:"id";i:65528556;s:4:"user";s:9:"kevinrose";s:6:"status";s:7:"popular";}i:5;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176877472;s:5:"story";i:1794432;s:2:"id";i:65528395;s:4:"user";s:9:"kevinrose";s:6:"status";s:7:"popular";}i:6;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176857787;s:5:"story";i:1792060;s:2:"id";i:65485850;s:4:"user";s:9:"kevinrose";s:6:"status";s:7:"popular";}i:7;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176850782;s:5:"story";i:1781720;s:2:"id";i:65468359;s:4:"user";s:9:"kevinrose";s:6:"status";s:7:"popular";}i:8;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176848403;s:5:"story";i:1780680;s:2:"id";i:65461429;s:4:"user";s:9:"kevinrose";s:6:"status";s:7:"popular";}i:9;O:11:"DiggAPIDigg":5:{s:4:"date";i:1176847067;s:5:"story";i:1789199;s:2:"id";i:65457469;s:4:"user";s:9:"kevinrose";s:6:"status";s:8:"upcoming";}}s:5:"count";i:10;}

 

Endpoints

 

Events are a combination of diggs and comments.

 

 

GET /stories/diggs
All diggs.
GET /stories/topic/{topic name}/diggs
Diggs on stories in a selected topic.
GET /stories/topics/{comma-separated list of topic names}/diggs
Diggs on stories in selected topics.
GET /stories/container/{container name}/diggs
Diggs on stories in a selected container.
GET /stories/containers/{comma-separated list of containers names}/diggs
Diggs on stories in selected containers.
GET /stories/popular/diggs
Diggs on popular stories.
GET /stories/topic/{topic name}/popular/diggs
Diggs on popular stories in a selected topic.
GET /stories/topics/{comma-separated list of topic names}/popular/diggs
Diggs on popular stories in selected topics.
GET /stories/container/{container name}/popular/diggs
Diggs on popular stories in a selected container.
GET /stories/containers/{comma-separated list of containers names}/popular/diggs
Diggs on popular stories in selected containers.
GET /stories/upcoming/diggs
Diggs on upcoming stories.
GET /stories/topic/{topic name}/upcoming/diggs
Diggs on upcoming stories in a selected topic.
GET /stories/topics/{comma-separated list of topic names}/upcoming/diggs
Diggs on upcoming stories in selected topics.
GET /stories/container/{container name}/upcoming/diggs
Diggs on upcoming stories in a selected container.
GET /stories/containers/{comma-separated list of containers names}/upcoming/diggs
Diggs on upcoming stories in selected containers.
GET /story/{story id}/diggs
All diggs for a given story.

404 Not Found response if the story does not exist.

GET /stories/{comma-separated list of story ids}/diggs
All diggs for a list of stories with the given ids. (E.g., GET /stories/984,1489,8575,174/diggs)
GET /user/{user name}/diggs
One user's diggs for all stories.

404 Not Found response if the user is unknown.

GET /users/{comma-separated list of user names}/diggs
Several users' diggs for all stories. (e.g. GET /users/sbwms,kevinrose/diggs) At most 100 user names may be listed.

404 Not Found response if any of the users is unknown.

GET /story/{story id}/user/{user name}/digg
One user digg for a given story.

404 Not Found response if the user has not dugg the story.

GET /stories/comments
All comments.
GET /stories/topic/{topic name}/comments
Comments on stories in a selected topic.
GET /stories/topics/{comma-separated list of topic names}/comments
Comments on stories in selected topics.
GET /stories/container/{container name}/comments
Comments on stories in a selected container.
GET /stories/containers/{comma-separated list of containers names}/comments
Comments on stories in selected containers.
GET /stories/popular/comments
Comments on popular stories.
GET /stories/topic/{topic name}/popular/comments
Comments on popular stories in a selected topic.
GET /stories/topics/{comma-separated list of topic names}/popular/comments
Comments on popular stories in selected topics.
GET /stories/container/{container name}/popular/comments
Comments on popular stories in a selected container.
GET /stories/containers/{comma-separated list of containers names}/popular/comments
Comments on popular stories in selected containers.
GET /stories/upcoming/comments
Comments on upcoming stories.
GET /stories/topic/{topic name}/upcoming/comments
Comments on upcoming stories in a selected topic.
GET /stories/topics/{comma-separated list of topic names}/upcoming/comments
Comments on upcoming stories in selected topics.
GET /stories/container/{container name}/upcoming/comments
Comments on upcoming stories in a selected container.
GET /stories/containers/{comma-separated list of containers names}/upcoming/comments
Comments on upcoming stories in selected containers.
GET /stories/{comma-separated list of story ids}/comments
All comments for a list of stories with the given ids. (e.g. GET /stories/984,1489,8575,174/comments) At most 100 story ids may be listed
GET /story/{story id}/comments
Top-level comments for a given story.

404 Not Found response if the story does not exist.

GET /user/{user name}/comments
One user's comments for all stories.

404 Not Found response if the user does not exist.

GET /users/{comma-separated list of user names}/comments
Several users' comments for all stories. (e.g. GET /users/sbwms,kevinrose/comments) At most 100 user names may be listed.

404 Not Found response if any of the users is unknown.

GET /story/{story id}/comment/{comment id}
One comment for a given story.

404 Not Found response if the story or comment do not exist.

GET /story/{story id}/comment/{comment id}/replies
One level of replies to one comment for a given story.

404 Not Found response if the story or comment do not exist.

 

Arguments

 

Additional query string parameters to endpoints above. See also ResponseTypes and ApplicationKeys.

 

min_date, max_date
Get events within a time period.
  • Values: Unix epoch integer.
  • Limits:
    • No limit in the following cases:
      • If one or more story IDs is specified.
      • If exactly one username is specified.
      • If a comment ID is specified.
    • Otherwise: One hour.
  • Defaults:
    • All time, in the following cases:
      • If one or more story IDs is specified.
      • If exactly one username is specified.
      • If a comment ID is specified.
    • Otherwise:
      • If both omitted: The last hour before the request.
      • If only min_date specified: One hour starting at the min_date.
      • If only max_date specified: One hour before the max_date.
sort
How to sort returned events.

One of:

date-desc: newest first (default).

date-asc: oldest first.

count
Number of events to retrieve.

Event count integer.

Default: 25, Maximum: 100.

offset
Offset in complete events list.

Event offset integer.

Default: 0.

media
Return events of selected media.

One of:

all: All media (default).

{medium}: The indicated medium.

{comma-separated list of media}: Any of the indicated media.

Each medium in must be the short_name attribute of one of the media returned by the List Media (link) endpoint, e.g. news, videos, or images.

 

Comments (0)

You don't have permission to comment on this page.