Created
June 4, 2009 16:11
-
-
Save makotoworld/123690 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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