LoginSignup
1
0

More than 3 years have passed since last update.

qiitaの限定公開一覧をわかりやすく

Last updated at Posted at 2020-03-29

qiitaの限定公開一覧がページネーションされてしまっていてタイトルを探しづらいので、
qiitaのAPIを利用して超簡易的に自分用に一覧を作りました。
{APIトークン} と {自分のユーザ名} の部分だけは書き換えてください。

<?
$res = exec('curl -H "Authorization: Bearer {APIトークン}" "https://qiita.com/api/v2/items?per_page=100&query=user:{自分のユーザ名}');
$json = json_decode($res);
foreach($json as $a){

    $tags = [];
    foreach($a->{"tags"} as $t){
        $tags[] = "[".$t->{"name"}."]";
    }
?>
<a href="<?= $a->{"url"} ?>" target="_blank"><?= $a->{"title"} ?></a> <?= implode(" ", $tags) ?><br>
<?
}
?>

これで自分の一覧がページネーションなしで表示されます。
スタイルも特に何も当てていないので適当に当ててください。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0