Skip to content

Instantly share code, notes, and snippets.

@makotoworld
Created June 4, 2009 16:11
Show Gist options
  • Save makotoworld/123690 to your computer and use it in GitHub Desktop.
Save makotoworld/123690 to your computer and use it in GitHub Desktop.
<?php
$appid = "appid";
$ya_url = 'http://jlp.yahooapis.jp/KeyphraseService/V1/extract?appid='.$appid.'&output=xml&sentence=';
$twi_url = $argv[1];
$logs = simplexml_load_file($twi_url);
foreach($logs->channel->item as $logs){
$i++;
$line[$i] = $logs->title;
}
for($i = 1; $i < count($line); $i++){
//print urlencode($line[$i]);
$log = simplexml_load_file($ya_url.urlencode($line[$i]));
foreach($log->Result as $log){
print "<".$i."件目>\n";
print "キーワード:".$log->Keyphrase."\n";
print "  スコア:".$log->Score."\n";
$i++;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment