0
私はanoterウェブページのニュースを私の上に表示したいが、私はこのための最良の方法を理解することはできない。他のウェブページのニュースを表示する
他のウェブページ上のニュースは、私はニュースを通じてサークルと自分のページ上に表示できるようにしたいと思い、次の
<div class="news-container">
<div class="news-list"><a href="news/1/" title="abcd"><img src="abcd.jpg" /><strong>abcd</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/1/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><a href="news/2/" title="efgh"><img src="efgh.jpg" /><strong>efgh</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/3/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><a href="news/3/" title="ijkl"><img src="ijkl.jpg" /><strong>ijkl</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/3/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><a href="news/4/" title="mnop"><img src="mnop.jpg" /><strong>mnop</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/4/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
のようなdivのクラス内に表示されており、私たち自身のサイトレイアウトに従って再配置されます。
<div class="other-news">
<div class="news-list"><strong>abcd</strong>
<p>What you see is what you get. <a href="news/1/" title="abcd"><img src="abcd.jpg" /></a></p>
</div>
<div class="news-list"><strong>efgh</strong>
<p>What you see is what you get. <a href="news/3/" title="abcd"><img src="efgh.jpg" /></a> </p>
</div>
<div class="news-list"><strong>ijkl</strong>
<p>What you see is what you get. <a href="news/3/" title="abcd"><img src="ijkl.jpg" /></a> </p>
</div>
<div class="news-list"><strong>mnop</strong>
<p>What you see is what you get. <a href="news/4/" title="abcd"><img src="mnop.jpg" /></a> </p>
</div>
すべての提案は歓迎以上です。
//あなたがPHPのcURLかのfile_get_contents(セキュリティ問題)を見たりPHP HTML DOMパーサを見てする必要がありますニューボー
合法性がチェックされています。本社には仕事をする人の力はない(!)。私はPHPのcURLとDOMパーサーを見てきましたが、どちらが最も簡単な方法で作業できるかわかりません。提案は大歓迎です。 – Nyborg
問題はありません。上記の方法の1つを使用するだけで、私はHTLM DOM Parserを推奨します - http://simplehtmldom.sourceforge.net/ – benhowdle89