YTMND:API:Interfaces

From YTMND
Revision as of 00:38, October 14, 2007 by BTape (Talk | contribs)

Jump to: navigation, search

Sites

Example request

http://api.ytmnd.com/sites/tomarnoldjungle

Example responses

XML

<?xml version="1.0" encoding="UTF-8"?>
<ytmnd_response timestamp="2007-10-14T00:57:48-05:00" request_type="site" extended_request="basic" returned_results="1">
 <sites>
  <site site_id="801024" domain="tomarnoldjungle" created="2007-08-15T01:47:04-05:00" modified="2007-08-15T14:28:41-05:00" classic_ytmnd="false">
   <user user_id="111682" user_name="BTape"/>
   <title>Tom Arnold Lost His Way In The Peruvian Jungle</title>
   <description>Tom Arnold got off the tour to get coffee... at the only place without a Starbucks.</description>
   <keywords>tom arnold, jungle</keywords>
   <site_text line_1="" line_2="" line_3="" image_text="false"/>
   <display_options background_color="1E3910" image_placement="center" synchronize="true" delay="0"/>
   <image_origin>http://tom-arnold.ytmnd.com/ + various</image_origin>
   <sound_origin>RJD2 - Ring Finger, various</sound_origin>
   <moderated work_safe="true"/>
   <assets>
    <asset type="thumb" asset_id="2427953" kilobytes="6" url="http://content.ytmnd.com/content/7/8/1/78155565973df3f223361eea4c5ba808.jpg"/>
   </assets>
   <score computed_score="3.7574" total_votes="202" vote_sum="759" score_image="stars_red_38.gif"/>
   <site_views today="0" yesterday="7" week="62" month="177" all_time="2922"/>
  </site>
 </sites>
</ytmnd_response>

JSON

{
 "timestamp":"2007-10-14T01:00:50-05:00",
 "request_type":"site",
 "extended_request":"basic",
 "returned_results":1,
 "sites":
 {
  "801024":
  {
   "site_id":"801024",
   "domain":"tomarnoldjungle",
   "created":"2007-08-15T01:47:04-05:00",
   "modified":"2007-08-15T14:28:41-05:00",
   "classic_ytmnd":false,
   "user":
   {
    "user_id":"111682",
    "user_name":"BTape"
   },
   "title":"Tom Arnold Lost His Way In The Peruvian Jungle",
   "description":"Tom Arnold got off the tour to get coffee... at the only place without a Starbucks.",
   "keywords":"tom arnold,jungle",
   "site_text":
   {
    "line_1":"",
    "line_2":"",
    "line_3":"",
    "image_text":false
   },
   "display_options":
   {
    "background_color":"1E3910",
    "image_placement":"center",
    "synchronize":true,
    "delay":0
   },
   "image_origin":"http:\/\/tom-arnold.ytmnd.com\/ + various",
   "sound_origin":"RJD2 - Ring Finger, various",
   "moderated":
   {
    "work_safe":true
   },
   "assets":
   {
    "2427953":
    {
     "type":"thumb",
     "asset_id":"2427953",
     "kilobytes":"6",
     "url":"http:\/\/content.ytmnd.com\/content\/7\/8\/1\/78155565973df3f223361eea4c5ba808.jpg"
    }
   },
   "score":
   {
    "computed_score":3.7574,
    "total_votes":"202",
    "vote_sum":"759",
    "score_image":"stars_red_38.gif"
   },
   "site_views":
   {
    "today":0,
    "yesterday":7,
    "week":62,
    "month":177,
    "all_time":2922
   }
  }
 }
}

PHP

a:5:
{
 s:9:"timestamp";
 s:25:"2007-10-14T01:21:37-05:00";
 s:12:"request_type";
 s:4:"site";
 s:16:"extended_request";
 s:5:"basic";
 s:16:"returned_results";
 i:1;
 s:5:"sites";
 a:1:
 {
  i:801024;
  a:17:
  {
   s:7:"site_id";
   s:6:"801024";
   s:6:"domain";
   s:15:"tomarnoldjungle";
   s:7:"created";
   s:25:"2007-08-15T01:47:04-05:00";
   s:8:"modified";
   s:25:"2007-08-15T14:28:41-05:00";
   s:13:"classic_ytmnd";
   b:0;s:4:"user";
   a:2:
   {
    s:7:"user_id";
    s:6:"111682";
    s:9:"user_name";
    s:5:"BTape";
   }
   s:5:"title";
   s:46:"Tom Arnold Lost His Way In The Peruvian Jungle";
   s:11:"description";
   s:83:"Tom Arnold got off the tour to get coffee... at the only place without a Starbucks.";
   s:8:"keywords";
   s:18:"tom arnold, jungle";
   s:9:"site_text";
   a:4:
   {
    s:6:"line_1";
    s:0:"";
    s:6:"line_2";
    s:0:"";
    s:6:"line_3";
    s:0:"";
    s:10:"image_text";
    b:0;
   }
   s:15:"display_options";
   a:4:
   {
    s:16:"background_color";
    s:6:"1E3910";
    s:15:"image_placement";
    s:6:"center";
    s:11:"synchronize";
    b:1;
    s:5:"delay";
    i:0;
   }
   s:12:"image_origin";
   s:38:"http://tom-arnold.ytmnd.com/ + various";
   s:12:"sound_origin";
   s:27:"RJD2 - Ring Finger, various";
   s:9:"moderated";
   a:1:
   {
    s:9:"work_safe";
    b:1;
   }
   s:6:"assets";
   a:1:
   {
    i:2427953;
    a:4:
    {
     s:4:"type";
     s:5:"thumb";
     s:8:"asset_id";
     s:7:"2427953";
     s:9:"kilobytes";
     s:1:"6";
     s:3:"url";
     s:75:"http://content.ytmnd.com/content/7/8/1/78155565973df3f223361eea4c5ba808.jpg";
    }
   }
   s:5:"score";
   a:4:
   {
    s:14:"computed_score";
    d:3.757400000000000073185901783290319144725799560546875;
    s:11:"total_votes";
    s:3:"202";
    s:8:"vote_sum";
    s:3:"759";
    s:11:"score_image";
    s:16:"stars_red_38.gif";
   }
   s:10:"site_views";
   a:5:
   {
    s:5:"today";
    i:0;
    s:9:"yesterday";
    i:7;
    s:4:"week";
    i:62;
    s:5:"month";
    i:177;
    s:8:"all_time";
    i:2922;
   }
  }
 }
}

Endpoints

GET /sites/{domain or id}

  • Site.

GET /sites/{domain or id}/comments

  • Site's comments.

GET /sites/{domain or id}/sponsors

  • Site's sponsors.

GET /sites/{domain or id}/favorites

  • Site's favorites.

Users

Example request

http://api.ytmnd.com/user/max

Example responses

XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<ytmnd_response timestamp="1192340109" request_type="user_lookup" extended_request="basic" returned_results="1">
  <users>
    <user user_id="1" signup_date="1081312566" user_name="max" />
  </users>
</ytmnd_response>

JSON

{
 "timestamp":1192340298,
 "request_type":"user_lookup",
 "extended_request":"basic",
 "returned_results":1,
 "users":
 {
  "1":
  {
   "signup_date":"1081312566",
   "user_name":"max",
   "user_id":"1"
  }
 }
}

PHP

a:5:
{
 s:9:"timestamp";
 i:1192340492;
 s:12:"request_type";
 s:11:"user_lookup";
 s:16:"extended_request";
 s:5:"basic";
 s:16:"returned_results";
 i:1;
 s:5:"users";
 a:1:
 {
  i:1;
  a:3:
  {
   s:11:"signup_date";
   s:10:"1081312566";
   s:9:"user_name";
   s:3:"max";
   s:7:"user_id";
   s:1:"1";
  }
 }
}

Endpoints

GET /user/{user name}

  • Named user.

GET /user/{user name}/all_sites

  • All of named user's sites.

GET /user/{user name}/recent_sites

  • Named user's 5 most recent sites.

GET /user/{user name}/recent_comments

  • Named user's 5 most recent comments.