Created
January 1, 2015 02:05
-
-
Save elzup/f0c5c8614458b85d0710 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* | |
* TwitterAPI1.1 url snippets 生成 | |
*/ | |
require_once('./simple_html_dom.php'); | |
/*【保存版】TwitterAPI1.1 REST API 全項目解説 | DX.univ */ | |
$url = 'http://dx.24-7.co.jp/twitterapi1-1-rest-api/'; | |
$html = file_get_html($url); | |
foreach ($html->find('tr') as $tr) { | |
if (!$tr->find('td', 0) || !($tr->find('td', 0)->find('a'))) { | |
continue; | |
} | |
list($td1, $td_disc) = $tr->find('td'); | |
list($method, $query_base) = explode(' ', $td1->find('a', 0)->innertext); | |
$query = $query_base; | |
$discription = $td_disc->innertext; | |
echo <<<EOF | |
snippet $query | |
abbr $discription | |
options word | |
$query_base\n\n | |
EOF; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment