Skip to content

Instantly share code, notes, and snippets.

@nefo-mi
Created March 4, 2012 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nefo-mi/1974147 to your computer and use it in GitHub Desktop.
Save nefo-mi/1974147 to your computer and use it in GitHub Desktop.
twittering-modeからデータを抜き出すlispぽいの
M-:
(let((l(twittering-current-timeline-data)))(with-temp-file"~/a.txt"(mapc(lambda(tw)(insert"http://twitter.com/#!/"(cdr(assq'user-screen-name tw))"/status/"(cdr(assq'id tw))"\n"))l)))
で現在表示してるtimelineからデータを抜き出してtwitterのurlっぽいなにをファイルに保存する。
フィルタかけたい。
@cvmat
Copy link

cvmat commented Mar 5, 2012

正規表現"xhago"にマッチするtweetのURLを保存するなら、下記のようなコマンドでどうでしょうか。
保存したいtimelineが表示されているbuffer上でM-x my-save-urlsで起動できます。

(defun my-save-urls (file)
  (interactive "Ffilename: ")
  (let ((l (twittering-current-timeline-data))
        (regexp "xhago"))
    (with-temp-file file
      (mapc (lambda (tw)
              (let ((text (cdr (assq 'text tw))))
                (when (string-match regexp text)
                  (insert (twittering-get-status-url-from-alist tw) "\n"))))
            l))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment