{"action":"created","issue":{"url":"https://api.github.com/repos/etalab/udata/issues/268","labels_url":"https://api.github.com/repos/etalab/udata/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/etalab/udata/issues/268/comments","events_url":"https://api.github.com/repos/etalab/udata/issues/268/events","html_url":"https://github.com/etalab/udata/issues/268","id":118577525,"number":268,"title":"Provide a way to embed datasets cards within external websites","user":{"login":"davidbgk","id":3556,"avatar_url":"https://avatars.githubusercontent.com/u/3556?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbgk","html_url":"https://github.com/davidbgk","followers_url":"https://api.github.com/users/davidbgk/followers","following_url":"https://api.github.com/users/davidbgk/following{/other_user}","gists_url":"https://api.github.com/users/davidbgk/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbgk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbgk/subscriptions","organizations_url":"https://api.github.com/users/davidbgk/orgs","repos_url":"https://api.github.com/users/davidbgk/repos","events_url":"https://api.github.com/users/davidbgk/events{/privacy}","received_events_url":"https://api.github.com/users/davidbgk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-24T10:30:57Z","updated_at":"2015-11-24T22:02:10Z","closed_at":null,"body":"As a user, I want to embed a dataset on my own website in order to share data links with my visitors.\r\n\r\n## Example implementation\r\n\r\n\r\nTo be included by the user on his own website:\r\n\r\n```js\r\n<script>window.dgfr = (function(d, s, id) {\r\n  var js, fjs = d.getElementsByTagName(s)[0],\r\n    t = window.dgfr || {};\r\n  if (d.getElementById(id)) return t;\r\n  js = d.createElement(s);\r\n  js.id = id;\r\n  js.src = \"https://www.data.gouv.fr/static/widgets.js\";\r\n  fjs.parentNode.insertBefore(js, fjs);\r\n \r\n  t._e = [];\r\n  t.ready = function(f) {\r\n    t._e.push(f);\r\n  };\r\n \r\n  return t;\r\n}(document, \"script\", \"dgfr-wjs\"));</script>\r\n```\r\n\r\nAnd then wherever he wants to display the card:\r\n\r\n```html\r\n<div data-dgfr-dataset-id=\"53699e2aa3a729239d205dea\"></div>\r\n```\r\n\r\nOn our side, we have to develop the `widgets.js` script and the API returning the [oEmbed](http://oembed.com/) object to generate the appropriated card."},"comment":{"url":"https://api.github.com/repos/etalab/udata/issues/comments/159418394","html_url":"https://github.com/etalab/udata/issues/268#issuecomment-159418394","issue_url":"https://api.github.com/repos/etalab/udata/issues/268","id":159418394,"user":{"login":"noirbizarre","id":15725,"avatar_url":"https://avatars.githubusercontent.com/u/15725?v=3","gravatar_id":"","url":"https://api.github.com/users/noirbizarre","html_url":"https://github.com/noirbizarre","followers_url":"https://api.github.com/users/noirbizarre/followers","following_url":"https://api.github.com/users/noirbizarre/following{/other_user}","gists_url":"https://api.github.com/users/noirbizarre/gists{/gist_id}","starred_url":"https://api.github.com/users/noirbizarre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noirbizarre/subscriptions","organizations_url":"https://api.github.com/users/noirbizarre/orgs","repos_url":"https://api.github.com/users/noirbizarre/repos","events_url":"https://api.github.com/users/noirbizarre/events{/privacy}","received_events_url":"https://api.github.com/users/noirbizarre/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T22:02:10Z","updated_at":"2015-11-24T22:02:10Z","body":"Great ! :)\r\n\r\nI'm really curious about the implementation !"}}