org-feed.el 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. ;;; org-feed.el --- Add RSS feed items to Org files
  2. ;;
  3. ;; Copyright (C) 2009 Free Software Foundation, Inc.
  4. ;;
  5. ;; Author: Carsten Dominik <carsten at orgmode dot org>
  6. ;; Keywords: outlines, hypermedia, calendar, wp
  7. ;; Homepage: http://orgmode.org
  8. ;; Version: 6.24trans
  9. ;;
  10. ;; This file is part of GNU Emacs.
  11. ;;
  12. ;; GNU Emacs is free software: you can redistribute it and/or modify
  13. ;; it under the terms of the GNU General Public License as published by
  14. ;; the Free Software Foundation, either version 3 of the License, or
  15. ;; (at your option) any later version.
  16. ;; GNU Emacs is distributed in the hope that it will be useful,
  17. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;; GNU General Public License for more details.
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  22. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  23. ;;
  24. ;;; Commentary:
  25. ;; This module allows to create and change entries in an Org-mode
  26. ;; file triggered by items in an RSS feed. The basic functionality is
  27. ;; geared toward simply adding items found in a feed as outline nodes
  28. ;; in an Org file, but using hooks, other actions can be performed
  29. ;; including changing entries based on changes of items in the feed.
  30. ;;
  31. ;; Selecting feeds and target locations
  32. ;; -----------------------------------
  33. ;;
  34. ;; This module is configured through a single variable, `org-feed-alist'.
  35. ;; Here is an example, using a notes/tasks feed from reQall.com.
  36. ;;
  37. ;; (setq org-feed-alist
  38. ;; '(("ReQall"
  39. ;; "http://www.reqall.com/user/feeds/rss/a1b2c3....."
  40. ;; "~/org/feeds.org" "ReQall Entries")
  41. ;;
  42. ;; With this setup, the command `M-x org-feed-update-all' will
  43. ;; collect new entries in the feed at the given URL and create
  44. ;; entries as subheadings under the "ReQall Entries" heading in the
  45. ;; file "~/org.feeds.org". You can then change and even move these
  46. ;; entries, and they will not be added again (see below).
  47. ;; In addition to these standard elements, additional keyword-value
  48. ;; pairs are possible as part of a feed setting. For example, here
  49. ;; we de-select entries with a title containing
  50. ;; "reQall is typing what you said"
  51. ;; using the `:filter' argument:
  52. ;;
  53. ;; (setq org-feed-alist
  54. ;; '(("ReQall"
  55. ;; "http://www.reqall.com/user/feeds/rss/a1b2c3....."
  56. ;; "~/org/feeds.org" "ReQall Entries"
  57. ;; :filter my-reqall-filter)))
  58. ;;
  59. ;; (defun my-reqall-filter (e)
  60. ;; (if (string-match "reQall is typing what you said"
  61. ;; (plist-get e :title))
  62. ;; nil
  63. ;; e)
  64. ;;
  65. ;; See the docstring for `org-feed-alist' for more details.
  66. ;;
  67. ;; Keeping track of previously added entries
  68. ;; -----------------------------------------
  69. ;;
  70. ;; Since Org allows you to delete, archive, or move outline nodes,
  71. ;; org-feed.el needs to keep track of which feed items have been added
  72. ;; before, so that they will not be added again. For this, org-feed.el
  73. ;; stores information in a special drawer, FEEDSTATUS, under the heading
  74. ;; that received the input of the feed. For this reason, each feed must
  75. ;; have its own headline in an Org file. You should add FEEDSTATUS
  76. ;; to your list of drawers in the files that receive feed input:
  77. ;;
  78. ;; #+DRAWERS: PROPERTIES LOGBOOK FEEDSTATUS
  79. ;;
  80. ;; Acknowledgments
  81. ;; ----------------
  82. ;;
  83. ;; org-feed.el is based on ideas by Brad Bozarth who implemented a
  84. ;; similar mechanism using shell and awk scripts, and who in this
  85. ;; way made me for the first time look into an RSS feed, showing
  86. ;; how simple this really was. Because I wanted to include a
  87. ;; solution into Org with as few dependencies as possible, I
  88. ;; reimplemented his ideas in Emacs Lisp.
  89. ;;; Code:
  90. (require 'org)
  91. (declare-function url-retrieve-synchronously "url" (url))
  92. (defgroup org-feed nil
  93. "Options concerning RSS feeds as inputs for Org files."
  94. :tag "Org ID"
  95. :group 'org)
  96. ;;;###autoload
  97. (defcustom org-feed-alist nil
  98. "Alist specifying RSS feeds that should create inputs for Org.
  99. Each entry in this list specified an RSS feed tat should be queried
  100. to create inbox items in Org. Each entry is a list with the following items:
  101. name a custom name for this feed
  102. URL the Feed URL
  103. file the target Org file where entries should be listed
  104. headline the headline under which entries should be listed
  105. Additional arguments can be given using keyword-value pairs. Many of these
  106. specify functions that receive one or a list of \"entries\" as their single
  107. argument. An entry is a property list that describes a feed item. The
  108. property list has properties for each field in the item, for example `:title'
  109. for the `<title>' field and `:pubDate' for the publication date. In addition,
  110. it contains the following properties:
  111. `:item-full-text' the full text in the <item> tag
  112. `:guid-permalink' t when the guid property is a permalink
  113. :filter filter-function
  114. A function to select interesting entries in the feed. It gets a single
  115. entry as parameter. It should return the entry if it is relevant, or
  116. nil if it is not.
  117. :template template-string
  118. The default action on new items in the feed is to add them as children
  119. under the headline for the feed. The template describes how the entry
  120. should be formatted. If not given, it defaults to
  121. `org-feed-default-template'.
  122. :formatter formatter-function
  123. Instead of relying on a template, you may specify a function to format
  124. the outline node to be inserted as a child. This function gets passed
  125. a property list describing a single feed item, and it should return a
  126. string that is a properly formatted Org outline node of level 1.
  127. :new-handler function
  128. If adding new items as children to the outline is not what you want
  129. to do with new items, define a handler function that is called with
  130. a list of all new items in the feed, each one represented as a property
  131. list. The handler should do what needs to be done, and org-feed will
  132. mark all items given to this handler as \"handled\", i.e. they will not
  133. be passed to this handler again in future readings of the feed.
  134. When the handler is called, point will be at the feed headline.
  135. :changed-handler function
  136. This function gets passed a list of all entries that have been
  137. handled before, but are now still in the feed and have *changed*
  138. since last handled (as evidenced by a different sha1 hash).
  139. When the handler is called, point will be at the feed headline.
  140. "
  141. :group 'org-feed
  142. :type '(repeat
  143. (list :value ("" "http://" "" "")
  144. (string :tag "Name")
  145. (string :tag "Feed URL")
  146. (file :tag "File for inbox")
  147. (string :tag "Headline for inbox")
  148. (repeat :inline t
  149. (choice
  150. (list :inline t :tag "Filter"
  151. (const :filter)
  152. (symbol :tag "Filter Function"))
  153. (list :inline t :tag "Template"
  154. (const :template)
  155. (string :tag "Template"))
  156. (list :inline t :tag "Formatter"
  157. (const :formatter)
  158. (symbol :tag "Formatter Function"))
  159. (list :inline t :tag "New items handler"
  160. (const :new-handler)
  161. (symbol :tag "Handler Function"))
  162. (list :inline t :tag "Changed items"
  163. (const :changed-handler)
  164. (symbol :tag "Handler Function"))
  165. )))))
  166. (defcustom org-feed-default-template "\n* %h\n %U\n %description\n %a\n"
  167. "Template for the Org node created from RSS feed items.
  168. This is just the default, each feed can specify its own.
  169. Any fields from the feed item can be interpolated into the template with
  170. %name, for example %title, %description, %pubDate etc. In addition, the
  171. following special escapes are valid as well:
  172. %h the title, or the first line of the description
  173. %t the date as a stamp, either from <pubDate> (if present), or
  174. the current date.
  175. %T date and time
  176. %u,%U like %t,%T, but inactive time stamps
  177. %a A link, from <guid> if that is a permalink, else from <link>"
  178. :group 'org-feed
  179. :type '(string :tag "Template"))
  180. (defcustom org-feed-save-after-adding t
  181. "Non-nil means, save buffer after adding new feed items."
  182. :group 'org-feed
  183. :type 'boolean)
  184. (defcustom org-feed-retrieve-method 'url-retrieve-synchronously
  185. "The method to be used to retrieve a feed URL.
  186. This can be `curl' or `wget' to call these external programs, or it can be
  187. an Emacs Lisp function that will return a buffer containing the content
  188. of the file pointed to by the URL."
  189. :group 'org-feed
  190. :type '(choice
  191. (const :tag "Internally with url.el" url-retrieve-synchronously)
  192. (const :tag "Externally with curl" curl)
  193. (const :tag "Externally with wget" wget)
  194. (function :tag "Function")))
  195. (defcustom org-feed-before-adding-hook nil
  196. "Hook that is run before adding new feed items to a file.
  197. You might want to commit the file in its current state to version control,
  198. for example."
  199. :group 'org-feed
  200. :type 'hook)
  201. (defcustom org-feed-after-adding-hook nil
  202. "Hook that is run after new items have been added to a file.
  203. Depending on `org-feed-save-after-adding', the buffer will already
  204. have been saved."
  205. :group 'org-feed
  206. :type 'hook)
  207. (defvar org-feed-buffer "*Org feed*"
  208. "The buffer used to retrieve a feed.")
  209. ;;;###autoload
  210. (defun org-feed-update-all ()
  211. "Get inbox items from all feeds in `org-feed-alist'."
  212. (interactive)
  213. (let ((nfeeds (length org-feed-alist))
  214. (nnew (apply '+ (mapcar 'org-feed-update org-feed-alist))))
  215. (message "%s from %d %s"
  216. (cond ((= nnew 0) "No new entries")
  217. ((= nnew 1) "1 new entry")
  218. (t (format "%d new entries" nnew)))
  219. nfeeds
  220. (if (= nfeeds 1) "feed" "feeds"))))
  221. ;;;###autoload
  222. (defun org-feed-update (feed &optional retrieve-only)
  223. "Get inbox items from FEED.
  224. FEED can be a string with an association in `org-feed-alist', or
  225. it can be a list structured like an entry in `org-feed-alist'."
  226. (interactive (list (org-completing-read "Feed name: " org-feed-alist)))
  227. (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
  228. (unless feed
  229. (error "No such feed in `org-feed-alist"))
  230. (catch 'exit
  231. (let ((name (car feed))
  232. (url (nth 1 feed))
  233. (file (nth 2 feed))
  234. (headline (nth 3 feed))
  235. (filter (nth 1 (memq :filter feed)))
  236. (formatter (nth 1 (memq :formatter feed)))
  237. (new-handler (nth 1 (memq :new-handler feed)))
  238. (changed-handler (nth 1 (memq :changed-handler feed)))
  239. (template (or (nth 1 (memq :template feed))
  240. org-feed-default-template))
  241. feed-buffer inbox-pos
  242. entries old-status status new changed guid-alist e guid olds)
  243. (setq feed-buffer (org-feed-get-feed url))
  244. (unless (and feed-buffer (bufferp feed-buffer))
  245. (error "Cannot get feed %s" name))
  246. (when retrieve-only
  247. (throw 'exit feed-buffer))
  248. (setq entries (org-feed-parse-feed feed-buffer))
  249. (ignore-errors (kill-buffer feed-buffer))
  250. (save-excursion
  251. (save-window-excursion
  252. (setq inbox-pos (org-feed-goto-inbox-internal file headline))
  253. (setq old-status (org-feed-read-previous-status inbox-pos))
  254. ;; Add the "handled" status to the appropriate entries
  255. (setq entries (mapcar (lambda (e)
  256. (setq e (plist-put e :handled
  257. (nth 1 (assoc
  258. (plist-get e :guid)
  259. old-status)))))
  260. entries))
  261. ;; Find out which entries are new and which are changed
  262. (dolist (e entries)
  263. (if (not (plist-get e :handled))
  264. (push e new)
  265. (setq olds (nth 2 (assoc (plist-get e :guid) old-status)))
  266. (if (and olds
  267. (not (string= (sha1-string (plist-get e :item-full-text))
  268. olds)))
  269. (push e changed))))
  270. ;; Parse the relevant entries fully
  271. (setq new (mapcar 'org-feed-parse-entry new)
  272. changed (mapcar 'org-feed-parse-entry changed))
  273. ;; Run the filter
  274. (when filter
  275. (setq new (delq nil (mapcar filter new))
  276. changed (delq nil (mapcar filter new))))
  277. (when (not (or new changed))
  278. (message "No new items in feed %s" name)
  279. (throw 'exit 0))
  280. ;; Get alist based on guid, to look up entries
  281. (setq guid-alist
  282. (append
  283. (mapcar (lambda (e) (list (plist-get e :guid) e)) new)
  284. (mapcar (lambda (e) (list (plist-get e :guid) e)) changed)))
  285. ;; Construct the new status
  286. (setq status
  287. (mapcar
  288. (lambda (e)
  289. (setq guid (plist-get e :guid))
  290. (list guid
  291. ;; things count as handled if we handle them now,
  292. ;; or if they were handled previously
  293. (if (assoc guid guid-alist) t (plist-get e :handled))
  294. ;; A hash, to detect changes
  295. (sha1-string (plist-get e :item-full-text))))
  296. entries))
  297. ;; Handle new items in the feed
  298. (when new
  299. (if new-handler
  300. (progn
  301. (goto-char inbox-pos)
  302. (funcall new-handler new))
  303. ;; No custom handler, do the default adding
  304. ;; Format the new entries into an alist with GUIDs in the car
  305. (setq new-formatted
  306. (mapcar
  307. (lambda (e) (org-feed-format-entry e template formatter))
  308. new)))
  309. ;; Insert the new items
  310. (org-feed-add-items inbox-pos new-formatted))
  311. ;; Handle changed items in the feed
  312. (when (and changed-handler changed)
  313. (goto-char inbox-pos)
  314. (funcall changed-handler changed))
  315. ;; Write the new status
  316. ;; We do this only now, in case something goes wrong above, so
  317. ;; that would would end up with a status that does not reflect
  318. ;; which items truely have been handled
  319. (org-feed-write-status inbox-pos status)
  320. ;; Normalize the visibility of the inbox tree
  321. (goto-char inbox-pos)
  322. (hide-subtree)
  323. (show-children)
  324. (org-cycle-hide-drawers 'children)
  325. ;; Hooks and messages
  326. (when org-feed-save-after-adding (save-buffer))
  327. (message "Added %d new item%s from feed %s to file %s, heading %s"
  328. (length new) (if (> (length new) 1) "s" "")
  329. name
  330. (file-name-nondirectory file) headline)
  331. (run-hooks 'org-feed-after-adding-hook)
  332. (length new))))))
  333. ;;;###autoload
  334. (defun org-feed-goto-inbox (feed)
  335. "Go to the inbox that captures the feed named FEED."
  336. (interactive
  337. (list (if (= (length org-feed-alist) 1)
  338. (car org-feed-alist)
  339. (org-completing-read "Feed name: " org-feed-alist))))
  340. (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
  341. (unless feed
  342. (error "No such feed in `org-feed-alist"))
  343. (org-feed-goto-inbox-internal (nth 2 feed) (nth 3 feed)))
  344. ;;;###autoload
  345. (defun org-feed-show-raw-feed (feed)
  346. "Show the raw feed buffer of a feed."
  347. (interactive
  348. (list (if (= (length org-feed-alist) 1)
  349. (car org-feed-alist)
  350. (org-completing-read "Feed name: " org-feed-alist))))
  351. (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
  352. (unless feed
  353. (error "No such feed in `org-feed-alist"))
  354. (switch-to-buffer
  355. (org-feed-update feed 'retrieve-only))
  356. (goto-char (point-min)))
  357. (defun org-feed-goto-inbox-internal (file heading)
  358. "Find or create HEADING in FILE.
  359. Switch to that buffer, and return the position of that headline."
  360. (find-file file)
  361. (widen)
  362. (goto-char (point-min))
  363. (if (re-search-forward
  364. (concat "^\\*+[ \t]+" heading "[ \t]*\\(:.*?:[ \t]*\\)?$")
  365. nil t)
  366. (goto-char (match-beginning 0))
  367. (goto-char (point-max))
  368. (insert "\n\n* " heading "\n\n")
  369. (org-back-to-heading t))
  370. (point))
  371. (defun org-feed-read-previous-status (pos)
  372. "Get the alist of old GUIDs from the entry at POS.
  373. This will find the FEEDSTATUS drawer and extract the alist."
  374. (save-excursion
  375. (goto-char pos)
  376. (let ((end (save-excursion (org-end-of-subtree t t))))
  377. (if (re-search-forward
  378. "^[ \t]*:FEEDSTATUS:[ \t]*\n\\([^\000]*?\\)\n[ \t]*:END:"
  379. end t)
  380. (read (match-string 1))
  381. nil))))
  382. (defun org-feed-write-status (pos status)
  383. "Write the feed status to the FEEDSTATUS drawer."
  384. (save-excursion
  385. (goto-char pos)
  386. (let ((end (save-excursion (org-end-of-subtree t t)))
  387. guid)
  388. (if (re-search-forward "^[ \t]*:FEEDSTATUS:[ \t]*\n" end t)
  389. (progn
  390. (goto-char (match-end 0))
  391. (delete-region (point)
  392. (save-excursion
  393. (and (re-search-forward "^[ \t]*:END:" nil t)
  394. (match-beginning 0)))))
  395. (outline-next-heading)
  396. (insert " :FEEDSTATUS:\n :END:\n")
  397. (beginning-of-line 0))
  398. (insert (pp-to-string status)))))
  399. (defun org-feed-add-items (pos entries)
  400. "Add the formatted items to the headline as POS."
  401. (let (entry level)
  402. (save-excursion
  403. (goto-char pos)
  404. (unless (looking-at org-complex-heading-regexp)
  405. (error "Wrong position"))
  406. (setq level (org-get-valid-level (length (match-string 1)) 1))
  407. (org-end-of-subtree t t)
  408. (skip-chars-backward " \t\n")
  409. (beginning-of-line 2)
  410. (setq pos (point))
  411. (while (setq entry (pop entries))
  412. (org-paste-subtree level entry 'yank))
  413. (org-mark-ring-push pos))))
  414. (defun org-feed-format-entry (entry template formatter)
  415. "Format ENTRY so that it can be inserted into an Org file.
  416. ENTRY is a property list. This function adds a `:formatted-for-org' property
  417. and returns the full property list.
  418. If that property is already present, nothing changes."
  419. (if formatter
  420. (funcall formatter entry)
  421. (let (dlines fmt tmp indent time
  422. v-h v-t v-T v-u v-U v-a)
  423. (setq dlines (org-split-string (or (plist-get entry :description) "???")
  424. "\n")
  425. v-h (or (plist-get entry :title) (car dlines) "???")
  426. time (or (if (plist-get entry :pubDate)
  427. (org-read-date t t (plist-get entry :pubDate)))
  428. (current-time))
  429. v-t (format-time-string (org-time-stamp-format nil nil) time)
  430. v-T (format-time-string (org-time-stamp-format t nil) time)
  431. v-u (format-time-string (org-time-stamp-format nil t) time)
  432. v-U (format-time-string (org-time-stamp-format t t) time)
  433. v-a (if (setq tmp (or (and (plist-get entry :guid-permalink)
  434. (plist-get entry :guid))
  435. (plist-get entry :link)))
  436. (concat "[[" tmp "]]\n")
  437. ""))
  438. (with-temp-buffer
  439. (insert template)
  440. (goto-char (point-min))
  441. (while (re-search-forward "%\\([a-zA-Z]+\\)" nil t)
  442. (setq name (match-string 1))
  443. (cond
  444. ((member name '("h" "t" "T" "u" "U" "a"))
  445. (replace-match (symbol-value (intern (concat "v-" name))) t t))
  446. ((setq tmp (plist-get entry (intern (concat ":" name))))
  447. (save-excursion
  448. (save-match-data
  449. (beginning-of-line 1)
  450. (when (looking-at (concat "^\\([ \t]*\\)%" name "[ \t]*$"))
  451. (setq tmp (org-feed-make-indented-block
  452. tmp (org-get-indentation))))))
  453. (replace-match tmp t t))))
  454. (buffer-string)))))
  455. (defun org-feed-make-indented-block (s n)
  456. "Add indentaton of N spaces to a multiline string S."
  457. (if (not (string-match "\n" s))
  458. s
  459. (mapconcat 'identity
  460. (org-split-string s "\n")
  461. (concat "\n" (make-string n ?\ )))))
  462. (defun org-feed-get-feed (url)
  463. "Get the RSS feed file at URL and return the buffer."
  464. (cond
  465. ((eq org-feed-retrieve-method 'url-retrieve-synchronously)
  466. (url-retrieve-synchronously url))
  467. ((eq org-feed-retrieve-method 'curl)
  468. (ignore-errors (kill-buffer org-feed-buffer))
  469. (call-process "curl" nil org-feed-buffer nil url)
  470. org-feed-buffer)
  471. ((eq org-feed-retrieve-method 'wget)
  472. (ignore-errors (kill-buffer org-feed-buffer))
  473. (call-process "curl" nil org-feed-buffer nil "-q" "-O" "-" url)
  474. org-feed-buffer)
  475. ((functionp org-feed-retrieve-method)
  476. (funcall org-feed-retrieve-method url))))
  477. (defun org-feed-parse-feed (buffer)
  478. "Parse BUFFER for RS feed entries.
  479. Returns a list of entries, with each entry a property list,
  480. containing the properties `:guid' and `:item-full-text'."
  481. (let (entries beg end item guid entry)
  482. (with-current-buffer buffer
  483. (widen)
  484. (goto-char (point-min))
  485. (while (re-search-forward "<item>" nil t)
  486. (setq beg (point)
  487. end (and (re-search-forward "</item>" nil t)
  488. (match-beginning 0)))
  489. (setq item (buffer-substring beg end)
  490. guid (if (string-match "<guid\\>.*?>\\(.*?\\)</guid>" item)
  491. (org-match-string-no-properties 1 item)))
  492. (setq entry (list :guid guid :item-full-text item))
  493. (push entry entries)
  494. (widen)
  495. (goto-char end))
  496. (nreverse entries))))
  497. (defun org-feed-parse-entry (entry)
  498. "Parse the `:item-full-text' field for xml tags and create new properties."
  499. (with-temp-buffer
  500. (insert (plist-get entry :item-full-text))
  501. (goto-char (point-min))
  502. (while (re-search-forward "<\\([a-zA-Z]+\\>\\).*?>\\([^\000]*?\\)</\\1>"
  503. nil t)
  504. (setq entry (plist-put entry
  505. (intern (concat ":" (match-string 1)))
  506. (match-string 2))))
  507. (goto-char (point-min))
  508. (unless (re-search-forward "isPermaLink[ \t]*=[ \t]*\"false\"" nil t)
  509. (setq entry (plist-put entry :guid-permalink t))))
  510. entry)
  511. (provide 'org-feed)
  512. ;;; org-feed.el ends here
  513. ;; arch-tag: 0929b557-9bc4-47f4-9633-30a12dbb5ae2
  514. ;1. parse all items
  515. ;2. filter with user filter
  516. ;3. Remove GUIDs that we have already *added* before
  517. ;4. Format, using user or built-in formatter
  518. ;5. add new items
  519. ;6. Store the guids from step 2, after the filtering
  520. ; This means that the feed could go back, have the entry
  521. ; pass the filter, and then it will be added.;
  522. ;Each item will be added once, when it first passes the filter.