List Gallery Photos

 


 

Fetches a list of gallery photos from Digg.

 

Example Request

 

Retrieve the three most recent gallery photos:

 

http://services.digg.com/galleryphotos?count=3&appkey=http%3A%2F%2Fexample.com%2fapplication

 

Example Responses

 

XML

 

<?xml version="1.0" encoding="utf-8" ?>
<gallery timestamp="1193358475" min_date="1190766450" total="31794" offset="0" count="3">
 <galleryphoto id="3920948" submit_date="1193358472" comments="0" src="http://digg.com/users/KalimaSaraswati/gallery/3920948/t.jpg" href="http://digg.com/users/KalimaSaraswati/gallery/3920948">
  <title>241_4171 Sun Halo Upper Tangent Arc.jpg</title>
  <user name="KalimaSaraswati" icon="http://digg.com/img/udl.png" registered="1193358174" profileviews="5" />
 </galleryphoto>
 <galleryphoto id="3920944" submit_date="1193358452" comments="0" src="http://digg.com/users/helina1988/gallery/3920944/t.jpg" href="http://digg.com/users/helina1988/gallery/3920944">
  <title>美女07.jpg</title>
  <user name="helina1988" icon="http://digg.com/img/udl.png" registered="1193358312" profileviews="1" />
 </galleryphoto>
 <galleryphoto id="3920943" submit_date="1193358449" comments="0" src="http://digg.com/users/BrianKJ/gallery/3920943/t.jpg" href="http://digg.com/users/BrianKJ/gallery/3920943">
  <title>BRIAN JUNKER (1988-    )</title>
  <user name="BrianKJ" icon="http://digg.com/users/BrianKJ/l.png" registered="1193358291" profileviews="5" />
 </galleryphoto>
</gallery>

 

JSON

 

{
    "timestamp" : 1193358478,
    "min_date" : 1190766450,
    "total" : "31794",
    "offset" : 0,
    "photos" : [
            {
                    "id" : 3920948,
                    "submit_date" : 1193358472, 
                    "comments" : 0,
                    "title" : "241_4171 Sun Halo Upper Tangent Arc.jpg",
                    "user" : {
                                "name" : "KalimaSaraswati",
                                "icon" : "http://digg.com/img/udl.png",
                                "registered" : 1193358174,
                                "profileviews" : 5
                              },
                    "src" : "http://digg.com/users/KalimaSaraswati/gallery/3920948/t.jpg",
                    "href" : "http://digg.com/users/KalimaSaraswati/gallery/3920948"
            },
            {
                    "id" : 3920944,
                    "submit_date" : 1193358452,
                    "comments" : 0,
                    "title" : "美女07.jpg",
                    "user" : {
                                "name" : "helina1988",
                                "icon" : "http://digg.com/img/udl.png",
                                "registered" : 1193358312,
                                "profileviews" : 1
                              },
                    "src" : "http://digg.com/users/helina1988/gallery/3920944/t.jpg",
                    "href" : "http://digg.com/users/helina1988/gallery/3920944"
            },
            {
                    "id" : 3920943,
                    "submit_date" : 1193358449,
                    "comments" : 0,
                    "title" : "BRIAN JUNKER (1988-    )",
                    "user" : {
                                "name" : "BrianKJ",
                                "icon" : "http://digg.com/users/BrianKJ/l.png",
                                "registered" : 1193358291,
                                "profileviews" : 5
                             },
                    "src" : "http://digg.com/users/BrianKJ/gallery/3920943/t.jpg",
                    "href" : "http://digg.com/users/BrianKJ/gallery/3920943"
            }
        }
    "count" : 3
}

 

PHP

 

O:14:"DiggAPIGallery":6:{s:9:"timestamp";i:1193358478;s:8:"min_date";i:1190766450;s:5:"total";s:5:"31794";s:6:"offset";i:0;s:6:"photos";a:3:{i:0;O:19:"DiggAPIGalleryPhoto":7:{s:2:"id";i:3920948;s:11:"submit_date";i:1193358472;s:8:"comments";i:0;s:5:"title";s:39:"241_4171 Sun Halo Upper Tangent Arc.jpg";s:4:"user";O:11:"DiggAPIUser":4:{s:4:"name";s:15:"KalimaSaraswati";s:4:"icon";s:27:"http://digg.com/img/udl.png";s:10:"registered";i:1193358174;s:12:"profileviews";i:5;}s:3:"src";s:59:"http://digg.com/users/KalimaSaraswati/gallery/3920948/t.jpg";s:4:"href";s:53:"http://digg.com/users/KalimaSaraswati/gallery/3920948";}i:1;O:19:"DiggAPIGalleryPhoto":7:{s:2:"id";i:3920944;s:11:"submit_date";i:1193358452;s:8:"comments";i:0;s:5:"title";s:12:"美女07.jpg";s:4:"user";O:11:"DiggAPIUser":4:{s:4:"name";s:10:"helina1988";s:4:"icon";s:27:"http://digg.com/img/udl.png";s:10:"registered";i:1193358312;s:12:"profileviews";i:1;}s:3:"src";s:54:"http://digg.com/users/helina1988/gallery/3920944/t.jpg";s:4:"href";s:48:"http://digg.com/users/helina1988/gallery/3920944";}i:2;O:19:"DiggAPIGalleryPhoto":7:{s:2:"id";i:3920943;s:11:"submit_date";i:1193358449;s:8:"comments";i:0;s:5:"title";s:24:"BRIAN JUNKER (1988-    )";s:4:"user";O:11:"DiggAPIUser":4:{s:4:"name";s:7:"BrianKJ";s:4:"icon";s:35:"http://digg.com/users/BrianKJ/l.png";s:10:"registered";i:1193358291;s:12:"profileviews";i:5;}s:3:"src";s:51:"http://digg.com/users/BrianKJ/gallery/3920943/t.jpg";s:4:"href";s:45:"http://digg.com/users/BrianKJ/gallery/3920943";}}s:5:"count";i:3;}

 

Endpoints

 

GET /galleryphotos
All gallery photos.
GET /galleryphotos/{list}
A list of galleryphotos with the given ids. (E.g., GET /galleryphotos/984,1489,8575,174)
403 Forbidden with explanatory message for more than 100 ids.
GET /galleryphoto/{id}
Identified gallery photo
404 Not Found for non-existent gallery photo.
GET /galleryphotos/comments
All gallery photo comments.
GET /galleryphotos/{list}/comments
Several gallery photos' comments, e.g. GET /galleryphotos/12345,6789/comments
404 Not Found response if any of the ids are non-existent user photos.
403 Forbidden with explanatory message for more than 100 ids.
GET /galleryphoto/{id}/comments
Top-level comments for a given gallery photo.
404 Not Found response if the gallery photo does not exist.
GET /galleryphoto/{id}/comment/{id}
One comment for a given gallery photo.
404 Not Found response if the photo or comment do not exist.
GET /galleryphoto/{id}/comment/{id}/replies
One level of replies to one comment for a given gallery photo.
404 Not Found response if the photo or comment do not exist.

 

Arguments

 

Additional query string parameters to endpoints above. See also Response Types and Application Keys.

 

min_submit_date, max_submit_date
Get gallery photos submitted within a given time period.
  • Values: Unix epoch integer.
  • Limit:
    • No limit, in the following cases:
      • If one or more photo IDs are specified.
    • Otherwise: 30 days.
  • Defaults:
    • All time, in the following cases:
      • If one or more photo IDs are specified.
    • Otherwise:
      • If both omitted: The 30 days before the request.
      • If only min_submit_date specified: 30 days starting at the min_submit_date.
      • If only max_submit_date specified: The 30 days preceding the max_submit_date.
sort
How to sort returned gallery photos.
One of:
submit_date-desc: newest-submitted first (default).
submit_date-asc: oldest-submitted first.
digg_count-desc: highest digg count first.
digg_count-asc: lowest digg count first.
count
Number of gallery photos to retrieve.
gallery photos count integer.
Default: 10, Maximum: 100.
403 Forbidden with explanatory message is returned for count > 100.
offset
Offset in complete gallery photos list.
Gallery photos offset integer.
Default: 0.


Page Information

  • 5 months ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts