向该 URL 发送请求,响应将是一个 JSON 文件,其中包含创建小部件所需的所有信息。
这是一个例子:
$ curl http://soundcloud.com/oembed\?format\=js\&url\=https://soundcloud.com/spadgos\&iframe\=true
({
"version": 1.0,
"type": "rich",
"provider_name": "SoundCloud",
"provider_url": "http://soundcloud.com",
"height": 450,
"width": "100%",
"title": "nickf \u2603",
"description": "",
"thumbnail_url": "http://i1.sndcdn.com/avatars-000005187616-3e82aa-t500x500.jpg?b96a101",
"html": "\u003Ciframe width=\"100%\" height=\"450\" scrolling=\"no\" frameborder=\"no\" src=\"http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fusers%2F6431392\u0026show_artwork=true\"\u003E\u003C/iframe\u003E",
"author_name": "nickf \u2603",
"author_url": "http://soundcloud.com/spadgos"
});
只需抓住html
财产并将其粘贴在您的文件中,就可以了。