この記事はxyttr Advent Calendar 2011の記事です。 今回はタイムラインに流れてきたGistの内容をxyzzy内で表示する拡張を書いてみます。 githubはGists APIを提供していて、JSON形式で簡単にGistの投稿内容を取得できます。 これを使ってコマンドを作りましょう。 (in-package :xyttr) ;;; カーソル下のGist URLの内容を表示する (defun show-gist () (interactive) ; カーソル下のURLを取得 (whenlet url (expand-focused-url) ; gistのURLだったらIDを取得 (whenlet id (and (string-match "https://gist\\.github\\.com/\\([0-9]+\\)\\(#.+\\)?$" url) (match
![Gistの表示 (xyttr Advent Calendar 4日目) - * *scrap*](https://cdn-ak-scissors.b.st-hatena.com/image/square/d9348fdfd043ce61ea5a8942878811849b5dd803/height=288;version=1;width=512/http%3A%2F%2Fgyazo.com%2F5fe62085cc964a2e9941cd8ec0e18780.png)