Upgrade to Pro — share decks privately, control downloads, hide ads and more …

oEmbed と Text::Hatena

oEmbed と Text::Hatena

Yasuhiro Onishi

March 18, 2012
Tweet

More Decks by Yasuhiro Onishi

Other Decks in Programming

Transcript

  1. P&NCFESFTQPOTF {        "version":  "1.0",      

     "type":  "photo",        "width":  240,        "height":  160,        "title":  "ZB8T0193",        "url":  "http://farm4.static.flickr.com/3123/2341623661_7c99f48bbf_m.jpg",        "author_name":  "Bees",        "author_url":  "http://www.flickr.com/photos/bees/",        "provider_name":  "Flickr",        "provider_url":  "http://www.flickr.com/" }
  2. 8FCP&NCFE IUUQTNFUBDQBOPSHNPEVMF8FCP&NCFE use  Web::oEmbed; my  $consumer  =  Web::oEmbed-­‐>new({    

       format  =>  'json' }); $consumer-­‐>register_provider({        url    =>  'http://*.flickr.com/*',        api    =>  'http://www.flickr.com/services/oembed/', }); my  $response  =  $consumer-­‐>embed("http:// www.flickr.com/..."); print  $response-­‐>render;  #=>  <img  />
  3. P&NCFEEJTDPWFSZ <link  rel="alternate"  type="application/json+oembed"    href="http://flickr.com/services/oembed?url=...&format=json"        title="..."

     /> <link  rel="alternate"  type="text/xml+oembed"    href="http://flickr.com/services/oembed?url=...&format=xml"        title="..."  />