{"id":117,"date":"2007-02-05T01:53:57","date_gmt":"2007-02-04T16:53:57","guid":{"rendered":"https:\/\/deskplate.net\/blog\/2007\/02\/05\/dmm-rss%e8%a7%a3%e9%87%88\/"},"modified":"2007-02-05T01:53:57","modified_gmt":"2007-02-04T16:53:57","slug":"dmm-rss%e8%a7%a3%e9%87%88","status":"publish","type":"post","link":"https:\/\/deskplate.net\/blog\/archives\/117","title":{"rendered":"DMM RSS\u89e3\u91c8"},"content":{"rendered":"<p>PHP\u3092\u899a\u3048\u305f\u3066\u306e\u3053\u308d\u306eDMM\u306e\u30b5\u30a4\u30c8\u30b8\u30e3\u30f3\u30eb\u5225RSS\u3092\u8aad\u307f\u8fbc\u3093\u3067\u81ea\u5206\u306e\u30a2\u30d5\u30a3\u30ea\u30a8\u30a4\u30c8ID\u3092\u4ed8\u52a0\u3057\u3066HTML\u30da\u30fc\u30b8\u306b\u843d\u3068\u3059\u3068\u3044\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u307f\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u3060\u3063\u305f\u3089\u3001XML\/RSS.php \u3068\u304b SimpleXML \u3068\u304b Smarty \u3068\u304b\u4f7f\u3063\u3066\u3082\u3063\u3068\u30b7\u30f3\u30d7\u30eb\u306b\u7d44\u307f\u307e\u3059\u3051\u3069\uff57<br \/>\nCash\u3082\u4f7f\u3063\u3066\u6bce\u5ea6\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u907f\u3051\u305f\u307b\u3046\u304c\u3044\u3044\u3067\u3059\u306d\u30fc<br \/>\nDMM\u306eRSS\u306f\u3061\u3087\u3063\u3068\u9055\u3046\u304b\u3089\u3053\u3093\u306a\u98a8\u306b\u5f37\u5f15\u306b\u7d44\u307f\u307e\u3057\u305f\u3002<br \/>\n&lt;?php<br \/>\n\/\/\u30d8\u30c3\u30c0\u306fUTF-8<br \/>\nheader(&#8221; Content-Type: text\/html; charset=UTF-8&#8243; );<br \/>\n\/\/RSS\u306eURL<br \/>\n$url = &#8220;http:\/\/www.dmm.co.jp\/monthly\/alice\/-\/list\/=\/sort=date\/rss=create\/_jloff=1\/&#8221;;<br \/>\n\/\/\u81ea\u5206\u306e\u30a2\u30d5\u30a3\u30ea\u30a8\u30a4\u30c8ID<br \/>\n$id = &#8220;dmm\u306eid&#8221;;<br \/>\n$i = 0;<br \/>\n$_data = null;<br \/>\n\/\/\u6539\u884c\u3068\u304b\u305d\u3046\u3044\u3046\u8868\u793a\u4e0a\u306e\u90fd\u5408\u3067\u5f8c\u3067\u4f7f\u3046<br \/>\n$flg = 0;<br \/>\n$content_flg = 0;<br \/>\n\/\/RSS\u3092\u8aad\u307f\u8fbc\u3080<br \/>\nif( $_http = fopen( $url, &#8220;r&#8221; )){<br \/>\n\u3000\u3000while( !feof( $_http ) ){<br \/>\n\u3000\u3000\u3000\u3000$_data = fgets( $_http, 1024 );<br \/>\n\u3000\u3000\u3000\u3000if($flg == 1 ){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u4f55\u3082\u3057\u306a\u3044<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000if( substr_count($_data , &#8220;item&#8221;) &gt;0<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000|| substr_count($_data , &#8220;description&#8221;) &gt;0<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000|| substr_count($_data , &#8220;dc:date&#8221;) &gt;0<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000|| substr_count($_data , &#8220;dc:creator&#8221;) &gt;0<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000|| substr_count($_data , &#8220;package&#8221;) &gt;0<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u30bf\u30a4\u30c8\u30eb\u30bf\u30b0\u3092\u7f6e\u304d\u63db\u3048\u308b<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}else if( substr_count($_data , &#8220;title&#8221;) &gt;0 ){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$title = &#8220;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;&lt;title&gt;&#8221;, &#8220;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;&lt;\/title&gt;&#8221;, &#8220;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$title = $_data;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u30ea\u30f3\u30af\u304c\u3042\u308c\u3070\u81ea\u5206\u306eid\u3092\u4ed8\u52a0\u3059\u308b<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}else if( substr_count($_data , &#8220;link&#8221;) &gt;0 ){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$link = &#8220;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;&lt;link&gt;&#8221;, &#8220;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;&lt;\/link&gt;&#8221;, &#8220;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$link = $_data.$id;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u30ea\u30f3\u30af\u6574\u5f62<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000echo &#8220;&lt;table width=800 class=\\&#8221;maintable\\&#8221; &gt;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000echo &#8220;&lt;tr&gt;&lt;td colspan=2 align=left valign=middle&gt;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000echo &#8220;&lt;a href=\\&#8221;$link\\&#8221; target=\\&#8221;_blank\\&#8221;&gt;&lt;br&gt;&lt;b&gt;&lt;font  style=\\&#8221;color : blue;\\&#8221; style=\\&#8221;font-size:16px\\&#8221; &gt;$title&lt;\/font&gt;&lt;\/b&gt;&lt;\/a&gt;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000echo &#8220;&lt;\/td&gt;&lt;\/tr&gt;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u30b3\u30e1\u30f3\u30c8\u306e\u4e2d\u306b\u753b\u50cf\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3053\u3093\u306a\u98a8\u306b\u51fa\u3059<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}else if( substr_count($_data , &#8220;&lt;content:encoded&gt;&#8221;) &gt;0 ){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$content_flg = 1;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;&lt;![CDATA[&#8220;, &#8220;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$imgst = strpos($_data , &#8220;&lt;img&#8221;,0);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$imgend = strpos($_data , &#8220;&lt;\/a&gt;&#8221;,0);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$linkimage = substr($_data, $imgst, $imgend);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u30ea\u30f3\u30af\u5143\u306e\u753b\u50cf\u304c\u306a\u3044\u5834\u5408\u306fNOW PRINTING\u753b\u50cf\u3092\u51fa\u3059<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000if($linkimage == &#8221;) $linkimage = &#8220;&lt;img src=\\&#8221;http:\/\/yourvideo.heteml.jp\/file\/printing.jpg\\&#8221; border=\\&#8221;0\\&#8221;&gt;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000echo &#8220;&lt;tr&gt;&lt;td class=\\&#8221;maintd\\&#8221;&gt;&lt;a href=\\&#8221;$link\\&#8221; target=\\&#8221;_blank\\&#8221;&gt;$linkimage&lt;\/a&gt;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u4ee5\u4e0b\u30c7\u30fc\u30bf\u6574\u5f62\uff06\u30ea\u30f3\u30af\u304c\u3067\u304d\u308c\u3070ID\u3092\u4ed8\u52a0\u3057\u3066\u30ea\u30f3\u30af\u3059\u308b<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}else if( substr_count($_data , &#8220;\u53ce\u9332\u6642\u9593&#8221;) &gt;0 ){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$content_flg = 1;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = &#8220;&lt;\/td&gt;&lt;td align=left&gt;&#8221;.$_data;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;\\&#8221;&gt;&#8221;, &#8220;$id\\&#8221;&gt;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000echo $_data;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}else if( substr_count($_data , &#8220;\u30e0\u30fc\u30d3\u30fc\u30d7\u30ec\u30d3\u30e5\u30fc&#8221;) &gt;0 ){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$content_flg = 1;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = &#8220;&lt;a href=\\&#8221;$link\\&#8221; target=\\&#8221;_blank\\&#8221;&gt;&lt;b&gt;\u3082\u3063\u3068\u898b\u308b\uff01&lt;\/b&gt;&lt;\/a&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;td colspan=2 align=center&gt;&#8221;.$_data;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000echo $_data;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}else if( substr_count($_data , &#8220;&lt;\/content:encoded&gt;&#8221;) &gt;0 ){<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$content_flg = 1;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;]]&gt;&#8221;, &#8220;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = $_data.&#8221;&lt;br&gt;&lt;br&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&lt;br&gt;&#8221;;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000echo $_data;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}else{<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000$_data = str_replace(&#8220;\\&#8221;&gt;&#8221;, &#8220;$id\\&#8221;&gt;&#8221;, $_data);<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 echo $_data;<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000}<br \/>\n\u3000\u3000\u3000\u3000}<br \/>\n\u3000\u3000\u3000\u3000if( substr_count($_data , &#8220;\/image&#8221;) &gt;0 ) $flg = 1;<br \/>\n\u3000\u3000\u3000\u3000$i++;<br \/>\n\u3000\u3000}<br \/>\n\u3000\u3000fclose( $_http );<br \/>\n}<br \/>\n?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u3092\u899a\u3048\u305f\u3066\u306e\u3053\u308d\u306eDMM\u306e\u30b5\u30a4\u30c8\u30b8<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":0,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}