Code API

Code API

code/show

returns code’s information.

URL

http://api.jsdo.it/v0.2/code/show.json

Required parameters

  • user
  • path

Optional parameters

  • callback

    If you want to use jsonp.

  • source

    String js or html or css, or comma joined string of them. and all equals js,html,css.

Example

request:

http://api.jsdo.it/v0.2/code/show.json?user=edo_m18&path=dwxg&source=js,html

response:

{
  "source":{
    "html":"<div id=\"log\"></div>",
    "lisence":"MIT",
    "js":"// Generated by CoffeeScript 1.4.0\n(function() {\n  var base, log, logEl, startZoom, zoom;\n\n  logEl = document.getElementById('log');\n\n  log = function(mes) {\n    return logEl.innerHTML = mes;\n  };\n\n  zoom = 1000;\n\n  base = 100;\n\n  startZoom = zoom;\n\n  document.addEventListener(\"gesturechange\", function(e) {\n    var num;\n    num = e.scale * base - base;\n    log(startZoom + num);\n    return zoom = startZoom + num;\n  }, false);\n\n  document.addEventListener(\"gesturestart\", function() {\n    console.log('start');\n    return startZoom = zoom;\n  }, false);\n\n}).call(this);\n",
    "coffeescript":"\r\nlogEl = document.getElementById 'log'\r\n\r\nlog = (mes) ->\r\n    logEl.innerHTML = mes\r\n\r\nzoom = 1000\r\nbase = 100\r\nstartZoom = zoom\r\n\r\ndocument.addEventListener \"gesturechange\", (e) ->\r\n    num =  e.scale * base - base\r\n    log startZoom + num\r\n    zoom = startZoom + num\r\n, false\r\n\r\ndocument.addEventListener \"gesturestart\", ->\r\n    console.log 'start'\r\n    startZoom = zoom\r\n, false\r\n\r\n"
  },
  "thumbnail":{"wide":"http://jsdo-static-contents.s3.amazonaws.com/images/capture/d/w/x/dwxg_w.jpg","465":"http://jsdo-static-contents.s3.amazonaws.com/images/capture/d/w/x/dwxg.jpg","100":"http://jsdo-static-contents.s3.amazonaws.com/images/capture/d/w/x/dwxg_100.jpg"},
  "modified_date":"2013-03-25 20:44:46",
  "uid":"dwxg",
  "created_date":"2013-03-25 19:33:37",
  "path":"dwxg",
  "description":"# iOSのgestureイベントでScaleを取得する\r\n\r\n意外とハマった。\r\ngestureイベントは終了するまではスタート時からの相対的なスケールが返ってくるため\r\ngesturestart時に初期値をとっておき、それに対してのスケール分の差分を取ることで実装した。",
  "description_html":"<h1>iOSのgestureイベントでScaleを取得する</h1>\n\n<p>意外とハマった。\ngestureイベントは終了するまではスタート時からの相対的なスケールが返ってくるため\ngesturestart時に初期値をとっておき、それに対してのスケール分の差分を取ることで実装した。</p>\n",
  "statistic":{"forked":"0","favorite":"0","pageview":"254"},
  "user":{"icon":"http://jsdo-static-contents.s3.amazonaws.com/images/icon/8/f/9/4/8f94349d12190bdea5ad0a3296c66b652d1fef62_100.jpg","name":"edo_m18"},
  "url":"http://jsdo.it/edo_m18/dwxg","title":"iOSのgestureイベントでscaleを取ってみる"
}

code/children

returns code’s children(forked from the code).

URL

http://api.jsdo.it/v0.2/code/children.json

Required parameters

  • user
  • path

Optional parameters

  • callback

    If you want to use jsonp.

Example

request:

http://api.jsdo.it/v0.2/code/children.json?user=edo_m18&path=7ue1

response:

{
  "results": [
    {
      "thumbnail": {
        "wide": "http://jsdo.it/images/capture/j/e/G/jeGI_w.jpg",
        "465": "http://jsdo.it/images/capture/j/e/G/jeGI.jpg",
        "100": "http://jsdo.it/images/capture/j/e/G/jeGI_100.jpg"
      },
      "modified_date": "2011-02-07 17:02:15",
      "uid": "jeGI",
      "created_date": "2011-02-07 16:44:18",
      "path": "jeGI",
      "statistic": {
        "forked": "0",
        "favorite": "0",
        "pageview": "77"
      },
      "url": "http://jsdo.it/TyperG/jeGI",
      "user": {
        "icon": "http://jsdo.it/images/icon/1/5/7/d/157da300102a0a14b9676a47991144bdf39aa971_100.jpg",
        "name": "TyperG"
      },
      "title": "forked from: [Demo] Blur text for CSS3"
    },
    {
      "thumbnail": {
        "wide": "http://jsdo.it/img/common/thumb_nowcapturing_w.png",
        "465": "http://jsdo.it/img/common/thumb_nowcapturing_465.png",
        "100": "http://jsdo.it/img/common/thumb_nowcapturing_100.png"}
      ,
      "modified_date": "2011-02-26 10:47:43",
      "uid": "84Xv",
      "created_date": "2011-02-26 10:47:43",
      "path": "84Xv",
      "statistic": {
        "forked": "0",
        "favorite": "0",
        "pageview": "48"
      },
      "url": "http://jsdo.it/l_lawliet/84Xv",
      "user": {
        "icon": "http://jsdo.it/img/common/img_user_anonymous.gif",
        "name": "l_lawliet"
      },
      "title": "forked from: [Demo] Blur text for CSS3"
    },
    {
      "thumbnail": {
        "wide": "http://jsdo.it/img/common/thumb_nowcapturing_w.png",
        "465": "http://jsdo.it/img/common/thumb_nowcapturing_465.png",
        "100": "http://jsdo.it/img/common/thumb_nowcapturing_100.png"
      },
      "modified_date": "2011-03-27 06:16:16",
      "uid": "yjXs",
      "created_date": "2011-03-27 06:16:16",
      "path": "yjXs",
      "statistic": {
        "forked": "0",
        "favorite": "0",
        "pageview": "12"
      },
      "url": "http://jsdo.it/dadada/yjXs",
      "user": {
        "icon": "http://jsdo.it/img/common/img_user_anonymous.gif",
        "name": "dadada"
      },
      "title": "forked from: [Demo] Blur text for CSS3"
    }
  ]
}