all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Bastien <bzg@gnu.org>
Cc: York Zhao <gtdplatform@gmail.com>, Feng Shu <tumashu@gmail.com>,
	emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: html to org-mode
Date: Sat, 4 Jan 2014 08:48:04 -0500	[thread overview]
Message-ID: <CAJ51ETrk-f=8s+VFWp1h04wbZARoM3B-nJe6wwv0v2TB_jzDhg@mail.gmail.com> (raw)
In-Reply-To: <87wqigvwxz.fsf@bzg.ath.cx>

[-- Attachment #1: Type: text/plain, Size: 2080 bytes --]

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 &lt; &gt; 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 <bzg@gnu.org> wrote:

> York Zhao <gtdplatform@gmail.com> 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
>
>

[-- Attachment #2: Type: text/html, Size: 3253 bytes --]

      reply	other threads:[~2014-01-04 13:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-04  2:40 html to org-mode John Kitchin
2014-01-04  4:56 ` Feng Shu
2014-01-04  6:22   ` York Zhao
2014-01-04 10:54     ` Bastien
2014-01-04 13:48       ` John Kitchin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ51ETrk-f=8s+VFWp1h04wbZARoM3B-nJe6wwv0v2TB_jzDhg@mail.gmail.com' \
    --to=jkitchin@andrew.cmu.edu \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=gtdplatform@gmail.com \
    --cc=tumashu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.