ã¯ã¦ã¶ã®RSSã表示ãã mixiã¢ããªã試ãã«ä½ã£ã¦ã¿ã
ã¾ã ãHelloWorldã¬ãã«ã§ãããä½ã£ã¦ã¿ã¾ããã
<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="mixiapp x hatena_bookmark"> <Require feature="opensocial-0.8"/> </ModulePrefs> <Content type="html" view="home, profile"><![CDATA[ <h3 style="margin:0; padding:0;">Hotentry</h3> <div id="hotentries"></div> <script type="text/javascript"> // get rss var url = 'http://b.hatena.ne.jp/hotentry.rss'; var params = {}; params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET; params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED; params[gadgets.io.RequestParameters.NUM_ENTRIES] = 5; gadgets.io.makeRequest(url, function(res) { //var feed = res.data; var entries = res.data.Entry; var html = '<ul style="font-size:14px">'; for (var i=0,len=entries.length; i<len; i++) { var entry = entries[i]; var t = entry.Title; if (t.length > 10) t = t.substring(0, 8) + '..'; html += '<li style="margin-bottom:5px; margin-left:-20px;"><a href="' + entry.Link + '" title="' + htmlEscape(entry.Title) + '" target="_blank">' + t + '</a>'; html += '<a style="margin-left:5px" href="http://b.hatena.ne.jp/entry/' + entry.Link + '" target="_blank"><img border="0" style="vertical-align:middle" src="http://b.hatena.ne.jp/entry/image/' + entry.Link + '" /></a></li>'; } html += '</ul>'; document.getElementById('hotentries').innerHTML = html; }, params); function htmlEscape(str) { return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); } </script> ]]></Content> <Content type="html" view="canvas"><![CDATA[ <h3>Hotentry</h3> <div id="hotentries"></div> <script type="text/javascript"> // get rss var url = 'http://b.hatena.ne.jp/hotentry.rss'; var params = {}; params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET; params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED; params[gadgets.io.RequestParameters.NUM_ENTRIES] = 20; gadgets.io.makeRequest(url, function(res) { //var feed = res.data; var entries = res.data.Entry; var html = '<ul style="font-size:14px">'; for (var i=0,len=entries.length; i<len; i++) { var entry = entries[i]; html += '<li style="margin-bottom:5px"><a href="' + entry.Link + '" title="' + htmlEscape(entry.Title) + '" target="_blank">' + entry.Title + '</a>'; html += '<a style="margin-left:5px" href="http://b.hatena.ne.jp/entry/' + entry.Link + '" target="_blank"><img border="0" style="vertical-align:middle" src="http://b.hatena.ne.jp/entry/image/' + entry.Link + '" /></a></li>'; } html += '</ul>'; document.getElementById('hotentries').innerHTML = html; }, params); function htmlEscape(str) { return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); } </script> ]]></Content> </Module>
Canvas Viewã§ã¯ãããªæã
Profile, Home Viewã¯ã¡ãã£ã¨å°ãã
ã¾ããã ã®RSS readerã§ãorz
ã½ã¼ã·ã£ã«ã°ã©ãä½ã使ã£ã¦ãªãï¼¼(ï¼¾oï¼¾)ï¼
æ¬å½ã¯ãã¢ããªè¨ç½®è
(Owner)ãè¨å®ããidãä¿åãããã®idã®ãã¯ãRSSã表示ããããã¨æã£ãã®ã ããã©ã
mixiã¢ããªä¸ã§ã¯ãOwnerã®è¨å®ãæ°¸ç¶åãã¦ãä»ã¦ã¼ã¶ã«è¦ãããã¨ã¯ã§ããªãã£ã½ã(mixiã¢ããªã®å¤ã«ä¿åããã°ãããã ãããã©ï¼)ã®ã§ã
ã¨ããããã¯ããããã¨ã³ããªã«ãã¦ãããã
æ°ãåããããå¤ã«ä¿åãã¦ããããã²ããããæ¹ã試ãã¦ã¿ããã§ãã