<?php
$keyword = 'ソフトバンク';
$query = 'http://search.twitter.com/search?q='.urlencode($keyword);
$dom = new DomDocument('1.0','UTF-8');
@$dom->loadHTML( file_get_contents( $query ) );
$xpath = new DomXPath( $dom );
foreach( $xpath->query('///span[@class="msgtxt ja"]') as $element ){
echo $element->nodeValue."\n\n";
}
2010年1月21日木曜日
twitterでキーワードを検索して、その結果を出力するPHPスクリプト
登録:
コメントの投稿 (Atom)
0 件のコメント:
コメントを投稿