emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] html to org-mode


From: John Kitchin
Subject: Re: [O] html to org-mode
Date: Sat, 4 Jan 2014 08:48:04 -0500

It was actually org-feed (http://orgmode.org/worg/org-contrib/org-feed.html).

Here is an example usagethat downloads recent org-mode maillist entries and formats them in a list of org-headings. The formatter function does some character replacements, and makes the headings TODO items. I also defined a little function to speed up deleting headlines I don't want to keep.

#+BEGIN_SRC emacs-lisp
(defun textify (s)
"strip control and escaped html ^M < > etc"
(let ((output s))
;  (setq output (replace-regexp-in-string "
\\|
;" " " s))
  (setq output (replace-regexp-in-string "&lt;" "<" output))
  (setq output (replace-regexp-in-string "&gt;" ">" output))
  (setq output (replace-regexp-in-string "&quot;" "\"" output))
  (setq output (replace-regexp-in-string "<br \>" "
" output))
  (setq output (replace-regexp-in-string "<br\>" "
" output))
  output))

(defun my-formatter (e)
  "format for rss feed to eventually do something useful"
  (format "* TODO %S
%s

%s" (textify (plist-get e :title))
  (or (and (plist-get entry :guid-permalink)
                       (plist-get entry :guid))
                  (plist-get entry :link))
  (textify (plist-get e :description))))

(let* ((org-feed-alist
        `(("org" "http://rss.gmane.org/messages/complete/gmane.emacs.orgmode" "feeds-org.org" "org-mode" :formatter my-formatter))))
  (org-feed-update-all))

;; convenience to delete uninteresting articles
(defun delete-headline ()
  (interactive)
  (org-mark-subtree)
  (delete-forward-char 1))

(global-set-key (kbd "<f5>") 'delete-headline)
#+END_SRC

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Sat, Jan 4, 2014 at 5:54 AM, Bastien <address@hidden> wrote:
York Zhao <address@hidden> writes:

> What is org-rss, I couldn't find it. Can you give a link?

This is ox-rss.el in contrib/lisp/ if you clone Org or get it
as a .zip/.tar.gz archive.

--
 Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]