Skip to content

Instantly share code, notes, and snippets.

@hogashi
Last active August 4, 2016 17:42
Show Gist options
  • Save hogashi/edd7377534e32a7103f11a29532aa55b to your computer and use it in GitHub Desktop.
Save hogashi/edd7377534e32a7103f11a29532aa55b to your computer and use it in GitHub Desktop.
<?php
$word = '+' . $_GET['query'];
$page = shell_exec ( 'curl -o- http://ejje.weblio.jp/small/content/' . urlencode($word) . ' | tr "\n" "\000" | sed "s/<\/\(\|no\)script>/\n/g" | sed "s/<\(\|no\)script.*$//" | sed "s/<meta[^>]*>//" | sed "s/\"http\:\/\/ejje\.weblio\.jp\/small\/content\/\([^\"]*\)\"/\"\.\/ws\.php\?query=\1\"/g" | sed "s/\"http\:\/\/ejje\.weblio\.jp[^\"]*\"/\"\.\/ws\.php\"/g" | tr "\000" "\n"' );
print $page;
print "It works.<br>"; # 動作確認用文字列
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment