MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.117.158.174
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/org/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/org/org-feed.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:07:16 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/org/org-feed.el
;;; in Emacs version 24.3.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\301&\210\312\313\305\314\311\304\315\316&\210\312\317\320\321\311\304\315\322&\210\312\323\324\325\311\304\315\326&\210\312\327\330\331\311\304\315\332&\210\312\333\334\335\311\304\315\336&\210\312\337\305\340\311\304\315\341&\210\312\342\305\343\311\304\315\341&\207" [require org sha1 custom-declare-group org-feed nil "Options concerning RSS feeds as inputs for Org files." :tag "Org Feed" :group custom-declare-variable org-feed-alist "Alist specifying RSS feeds that should create inputs for Org.\nEach entry in this list specified an RSS feed tat should be queried\nto create inbox items in Org.  Each entry is a list with the following items:\n\nname         a custom name for this feed\nURL          the Feed URL\nfile         the target Org file where entries should be listed\nheadline     the headline under which entries should be listed\n\nAdditional arguments can be given using keyword-value pairs.  Many of these\nspecify functions that receive one or a list of \"entries\" as their single\nargument.  An entry is a property list that describes a feed item.  The\nproperty list has properties for each field in the item, for example `:title'\nfor the `<title>' field and `:pubDate' for the publication date.  In addition,\nit contains the following properties:\n\n`:item-full-text'   the full text in the <item> tag\n`:guid-permalink'   t when the guid property is a permalink\n\nHere are the keyword-value pair allows in `org-feed-alist'.\n\n:drawer drawer-name\n     The name of the drawer for storing feed information.  The default is\n     \"FEEDSTATUS\".  Using different drawers for different feeds allows\n     several feeds to target the same inbox heading.\n\n:filter filter-function\n     A function to select interesting entries in the feed.  It gets a single\n     entry as parameter.  It should return the entry if it is relevant, or\n     nil if it is not.\n\n:template template-string\n     The default action on new items in the feed is to add them as children\n     under the headline for the feed.  The template describes how the entry\n     should be formatted.  If not given, it defaults to\n     `org-feed-default-template'.\n\n:formatter formatter-function\n     Instead of relying on a template, you may specify a function to format\n     the outline node to be inserted as a child.  This function gets passed\n     a property list describing a single feed item, and it should return a\n     string that is a properly formatted Org outline node of level 1.\n\n:new-handler function\n     If adding new items as children to the outline is not what you want\n     to do with new items, define a handler function that is called with\n     a list of all new items in the feed, each one represented as a property\n     list.  The handler should do what needs to be done, and org-feed will\n     mark all items given to this handler as \"handled\", i.e. they will not\n     be passed to this handler again in future readings of the feed.\n     When the handler is called, point will be at the feed headline.\n\n:changed-handler function\n     This function gets passed a list of all entries that have been\n     handled before, but are now still in the feed and have *changed*\n     since last handled (as evidenced by a different sha1 hash).\n     When the handler is called, point will be at the feed headline.\n\n:parse-feed function\n     This function gets passed a buffer, and should return a list\n     of entries, each being a property list containing the\n     `:guid' and `:item-full-text' keys.  The default is\n     `org-feed-parse-rss-feed'; `org-feed-parse-atom-feed' is an\n     alternative.\n\n:parse-entry function\n     This function gets passed an entry as returned by the parse-feed\n     function, and should return the entry with interesting properties added.\n     The default is `org-feed-parse-rss-entry'; `org-feed-parse-atom-entry'\n     is an alternative." :type (repeat (list :value (#1="" "http://" #1# #1#) (string :tag "Name") (string :tag "Feed URL") (file :tag "File for inbox") (string :tag "Headline for inbox") (repeat :inline t (choice (list :inline t :tag "Filter" (const :filter) (symbol :tag "Filter Function")) (list :inline t :tag "Template" (const :template) (string :tag "Template")) (list :inline t :tag "Formatter" (const :formatter) (symbol :tag "Formatter Function")) (list :inline t :tag "New items handler" (const :new-handler) (symbol :tag "Handler Function")) (list :inline t :tag "Changed items" (const :changed-handler) (symbol :tag "Handler Function")) (list :inline t :tag "Parse Feed" (const :parse-feed) (symbol :tag "Parse Feed Function")) (list :inline t :tag "Parse Entry" (const :parse-entry) (symbol :tag "Parse Entry Function")))))) org-feed-drawer "FEEDSTATUS" "The name of the drawer for feed status information.\nEach feed may also specify its own drawer name using the `:drawer'\nparameter in `org-feed-alist'.\nNote that in order to make these drawers behave like drawers, they must\nbe added to the variable `org-drawers' or configured with a #+DRAWERS\nline." (string :tag "Drawer Name") org-feed-default-template "\n* %h\n  %U\n  %description\n  %a\n" "Template for the Org node created from RSS feed items.\nThis is just the default, each feed can specify its own.\nAny fields from the feed item can be interpolated into the template with\n%name, for example %title, %description, %pubDate etc.  In addition, the\nfollowing special escapes are valid as well:\n\n%h      The title, or the first line of the description\n%t      The date as a stamp, either from <pubDate> (if present), or\n        the current date\n%T      Date and time\n%u,%U   Like %t,%T, but inactive time stamps\n%a      A link, from <guid> if that is a permalink, else from <link>\n%(sexp) Evaluate elisp `(sexp)' and replace with the result, the simple\n        %-escapes above can be used as arguments, e.g. %(capitalize \\\"%h\\\")" (string :tag "Template") org-feed-save-after-adding t "Non-nil means save buffer after adding new feed items." boolean org-feed-retrieve-method 'url-retrieve-synchronously "The method to be used to retrieve a feed URL.\nThis can be `curl' or `wget' to call these external programs, or it can be\nan Emacs Lisp function that will return a buffer containing the content\nof the file pointed to by the URL." (choice (const :tag "Internally with url.el" url-retrieve-synchronously) (const :tag "Externally with curl" curl) (const :tag "Externally with wget" wget) (function :tag "Function")) org-feed-before-adding-hook "Hook that is run before adding new feed items to a file.\nYou might want to commit the file in its current state to version control,\nfor example." hook org-feed-after-adding-hook "Hook that is run after new items have been added to a file.\nDepending on `org-feed-save-after-adding', the buffer will already\nhave been saved."] 8)
#@37 The buffer used to retrieve a feed.
(defvar org-feed-buffer "*Org feed*" (#$ . 7493))
#@53 Get inbox items from all feeds in `org-feed-alist'.
(defalias 'org-feed-update-all #[nil "G\303\304\305\306\"\"\307\310	\311U\203\312\202%	\313U\203!\314\202%\315\316	\"\n\211\313U\2030\317\2021\320$*\207" [org-feed-alist nnew nfeeds apply + mapcar org-feed-update message "%s from %d %s" 0 "No new entries" 1 "1 new entry" format "%d new entries" "feed" "feeds"] 6 (#$ . 7585) nil])
#@156 Get inbox items from FEED.
FEED can be a string with an association in `org-feed-alist', or
it can be a list structured like an entry in `org-feed-alist'.
(defalias 'org-feed-update #[(feed &optional retrieve-only) ";\203\n\302	\"\204\303\304!\210\305\306\215\207" [feed org-feed-alist assoc error "No such feed in `org-feed-alist" exit (byte-code "@A@\3068\3078\310>A@\311>A@\312>A@\313>A@\314>A@\206(	\315>A@\2061\n\316>A@\206:\317\320>A@\206C\321\322\211\211\211\211\211\211\211\211\211\211\211?@ABCDEFGHIJKLMNOPQRS\323R!\211G\203\217\324\325G!!\204\225\326\327S\"\210T\203\240\330\331G\"\210IG!D\322\332\333\217\210\212\334 U\335\216\336QP\"F\337FJ\"C\340\341D\"\211D\322\211V\203V@\342
\343\"\204\347
ABA\202\306\344\342
\345\"C\"8\211\203\346\342
\347\"!\230\204
@B@VA\211V\204\323*\340HA\"A\340H@\"@O\203<\350\322\340OA\"\"A\350\322\340OA\"\"@A\204Q@\204Q\351\352S\"\210\330\331\353\"\210\354\340\355A\"\340\356@\"\"?\340\357D\"BA\203\213M\203}Fb\210MA!\210\202\204\340\360A\"E\361FE\"\210L\203\237@\203\237Fb\210L@!\210\362FJB#\210Fb\210\363 \210\364 \210\365\366!\210W\203\276\367 \210\351\370AGAG\371V\203\317\372\202\320\373S\374Q!P&\210\375\376!\210AG.\207" [feed org-feed-default-template org-feed-drawer olds guid e 2 3 :filter :formatter :new-handler :changed-handler :template :drawer :parse-feed org-feed-parse-rss-feed :parse-entry org-feed-parse-rss-entry nil org-feed-get-feed bufferp get-buffer error "Cannot get feed %s" throw exit (kill-buffer feed-buffer) ((error)) current-window-configuration ((set-window-configuration #1=#:wconfig)) org-feed-goto-inbox-internal org-feed-read-previous-status mapcar #[(e) "\302\303\304\305\306\"	\"A@#\211\207" [e old-status plist-put :handled assoc plist-get :guid] 7] plist-get :handled assoc :guid sha1 :item-full-text delq message "No new items in feed %s" 0 append #[(e) "\301\302\"D\207" [e plist-get :guid] 3] #[(e) "\301\302\"D\207" [e plist-get :guid] 3] #[(e) "\303\304\"\211\305	\n\"\203\306\202\303\307\"\310\303\311\"!E\207" [e guid guid-alist plist-get :guid assoc t :handled sha1 :item-full-text] 7] #[(e) "\303	\n#\207" [e template formatter org-feed-format-entry] 4] org-feed-add-items org-feed-write-status hide-subtree show-children org-cycle-hide-drawers children save-buffer "Added %d new item%s from feed %s to file %s, heading %s" 1 "s" "" file-name-nondirectory run-hooks org-feed-after-adding-hook guid-alist changed new status old-status entries new-formatted inbox-pos feed-buffer parse-entry parse-feed drawer template changed-handler new-handler formatter filter headline file url name retrieve-only #1# --dolist-tail-- org-feed-save-after-adding] 25)] 3 (#$ . 7987) (list (org-completing-read "Feed name: " org-feed-alist))])
#@52 Go to the inbox that captures the feed named FEED.
(defalias 'org-feed-goto-inbox #[(feed) ";\203\n\302	\"\204\303\304!\210\305\3068\3078\"\207" [feed org-feed-alist assoc error "No such feed in `org-feed-alist" org-feed-goto-inbox-internal 2 3] 4 (#$ . 10876) (list (if (= (length org-feed-alist) 1) (car org-feed-alist) (org-completing-read "Feed name: " org-feed-alist)))])
#@37 Show the raw feed buffer of a feed.
(defalias 'org-feed-show-raw-feed #[(feed) ";\203\n\302	\"\204\303\304!\210\305\306\307\"!\210eb\207" [feed org-feed-alist assoc error "No such feed in `org-feed-alist" org-pop-to-buffer-same-window org-feed-update retrieve-only] 4 (#$ . 11268) (list (if (= (length org-feed-alist) 1) (car org-feed-alist) (org-completing-read "Feed name: " org-feed-alist)))])
#@98 Find or create HEADING in FILE.
Switch to that buffer, and return the position of that headline.
(defalias 'org-feed-goto-inbox-internal #[(file heading) "\302!\210~\210eb\210\303\304	\305Q\306\307#\203\310\224b\210\202(db\210\311	\312\261\210\313\307!\210`\207" [file heading find-file re-search-forward "^\\*+[ 	]+" "[ 	]*\\(:.*?:[ 	]*\\)?$" nil t 0 "\n\n* " "\n\n" org-back-to-heading] 4 (#$ . 11679)])
#@96 Get the alist of old GUIDs from the entry at POS.
This will find DRAWER and extract the alist.
(defalias 'org-feed-read-previous-status #[(pos drawer) "\212b\210\212\303\304\211\")\305\306\n\307Q	\304#\205\310\311\312!!*\207" [pos end drawer org-end-of-subtree t re-search-forward "^[ 	]*:" ":[ 	]*\n\\([^]*?\\)\n[ 	]*:END:" read match-string 1] 4 (#$ . 12096)])
#@50 Write the feed STATUS to DRAWER in entry at POS.
(defalias 'org-feed-write-status #[(pos drawer status) "\212b\210\212\305\306\211\")\307\310\311\312Q\n\306#\203.\313\225b\210`\212\310\314\307\306#\205(\313\224)|\210\202;\315 \210\316\317\261\210\320\313!\210\321\f!c+\207" [pos guid end drawer status org-end-of-subtree t nil re-search-forward "^[ 	]*:" ":[ 	]*\n" 0 "^[ 	]*:END:" outline-next-heading "  :" ":\n  :END:\n" beginning-of-line pp-to-string] 5 (#$ . 12470)])
#@49 Add the formatted items to the headline as POS.
(defalias 'org-feed-add-items #[(pos entries) "\305\211\212\nb\210\306!\204\307\310!\210\311\312\313!G\313\"\314\315\211\"\210\316\305x\210\317\320!\210`\f\211A@\211\203<\321	\322#\210\202)\323\n!+\207" [level entry pos org-complex-heading-regexp entries nil looking-at error "Wrong position" org-get-valid-level match-string 1 org-end-of-subtree t " 	\n" beginning-of-line 2 org-paste-subtree yank org-mark-ring-push] 4 (#$ . 12958)])
#@227 Format ENTRY so that it can be inserted into an Org file.
ENTRY is a property list.  This function adds a `:formatted-for-org' property
and returns the full property list.
If that property is already present, nothing changes.
(defalias 'org-feed-format-entry #[(entry template formatter) "\306\307!\210\203\f	!\207\310\211\211\211\211\211\211\211\211\211\21189:;<=>\311\312	\313\"\2062\314\315\">\312	\316\"\206D>@\206D\3149\312	\317\"\203X\320\321\211\312	\317\"#\206Z\322 =\323\324\310\211\"=\"8\323\324\321\310\"=\"\323\324\310\321\"=\"\323\324\321\211\"=\"\312	\325\"\203\217\312	\326\"\206\223\312	\327\"\211:\203\241\330:\331Q\202\242\332\333\334!?r?q\210\335\216@c\210eb\210\336\337\310\321#\203(\340 \204\266\341\342!;\343 <;\344\235\203\337\345\346;P!J:\202\f\312	\345\347;P!\"\211:\203\f\212\350 A\351\216\352\342!\210\353\354;\355Q!\203\356:\357 \":+:\203\266<\203\360\361\362:#:\363:\321\211#\210\202\266\364 \210\365\366 \367ed\321#\".\207" [formatter entry v-a v-U v-u v-T require org-capture nil org-split-string plist-get :description "???" "\n" :title :pubDate org-read-date t current-time format-time-string org-time-stamp-format :guid-permalink :guid :link "[[" "]]\n" "" generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) re-search-forward "%\\([a-zA-Z]+\\)" org-capture-escaped-% match-string 1 org-capture-inside-embedded-elisp-p ("h" "t" "T" "u" "U" "a") intern "v-" ":" match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) beginning-of-line looking-at "^\\([ 	]*\\)%" "[ 	]*$" org-feed-make-indented-block org-get-indentation replace-regexp-in-string "\"" "\\\\\"" replace-match org-capture-expand-embedded-elisp decode-coding-string buffer-string detect-coding-region v-t v-h tmp name escape time dlines #1# template save-match-data-internal] 11 (#$ . 13461)])
#@54 Add indentation of N spaces to a multiline string S.
(defalias 'org-feed-make-indented-block #[(s n) "\302\303\"\204	\207\304\305\306\303\"\303\307	\310\"P#\207" [s n string-match "\n" mapconcat identity org-split-string make-string 32] 7 (#$ . 15438)])
#@85 Remove HTTP headers from BUFFER, and return it.
Assumes headers are indeed present!
(defalias 'org-feed-skip-http-headers #[(buffer) "rq\210~\210eb\210\301\302!\210e`|\210)\207" [buffer search-forward "\n\n"] 2 (#$ . 15702)])
#@53 Get the RSS feed file at URL and return the buffer.
(defalias 'org-feed-get-feed #[(url) "\303=\203\f\304\303	!!\207\305=\203#\306\307\310\217\210\311\312\306\n\306\313	&\210\n\207\314=\203<\306\315\316\217\210\311\317\306\n\306\320\321\322	&\210\n\207\323!\205E	!\207" [org-feed-retrieve-method url org-feed-buffer url-retrieve-synchronously org-feed-skip-http-headers curl nil (kill-buffer org-feed-buffer) ((error)) call-process "curl" "--silent" wget (kill-buffer org-feed-buffer) ((error)) "wget" "-q" "-O" "-" functionp] 9 (#$ . 15936)])
#@153 Parse BUFFER for RSS feed entries.
Returns a list of entries, with each entry a property list,
containing the properties `:guid' and `:item-full-text'.
(defalias 'org-feed-parse-rss-feed #[(buffer) "\306\307\211\211\211\211\211rq\210~\210eb\210\310\311\307\306#\203Y`\310\312\307\306#\205-\313\224\f{\314\315\n\"\205F\316\n\317\"*\320	\321\nF\211
B~\210b\210\202
\237.\207" [entry guid item end beg entries t nil re-search-forward "<item\\>.*?>" "</item>" 0 string-match "<guid\\>.*?>\\(.*?\\)</guid>" 1 match-string-no-properties :guid :item-full-text case-fold-search buffer string num] 8 (#$ . 16498)])
#@75 Parse the `:item-full-text' field for xml tags and create new properties.
(defalias 'org-feed-parse-rss-entry #[(entry) "\302\303!\210\304\305!rq\210\306\216\307	\310\"c\210eb\210\311\312\313\314#\2032\315	\316\317\320\321!P!\322\320\323!!#\202eb\210\311\324\313\314#\204C\315	\325\314#+	\207" [#1=#:temp-buffer entry require xml generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) plist-get :item-full-text re-search-forward "<\\([a-zA-Z]+\\>\\).*?>\\([^]*?\\)</\\1>" nil t plist-put intern ":" match-string 1 xml-substitute-special 2 "isPermaLink[ 	]*=[ 	]*\"false\"" :guid-permalink] 6 (#$ . 17142)])
#@263 Parse BUFFER for Atom feed entries.
Returns a list of entries, with each entry a property list,
containing the properties `:guid' and `:item-full-text'.

The `:item-full-text' property actually contains the sexp
formatted as a string, not the original XML data.
(defalias 'org-feed-parse-atom-feed #[(buffer) "\302\303!\210rq\210~\210\304ed\"@\305\306\307	\310\"\"*\207" [buffer feed require xml xml-parse-region mapcar #[(entry) "\301\302\303\304\"@!@\305\306!F\207" [entry :guid xml-node-children xml-get-children id :item-full-text prin1-to-string] 5] xml-get-children entry] 5 (#$ . 17820)])
#@66 Parse the `:item-full-text' as a sexp and create new properties.
(defalias 'org-feed-parse-atom-entry #[(entry) "\304\305\306\"!@\307\310\311\312	\313\"@\314\"#\307\315\316\317\312	\320\"@!@!#\312	\302\"@\321\n\303\"\n\203w\322\230\203G\307\323\316\317\n!@!#\202w\324\230\203[\307\323\316\317\n!@!#\202w\325\230\203n\307\323\326\317\n!!#\202w\307\323\327\330\"#*)\207" [entry xml content type read-from-string plist-get :item-full-text plist-put :link xml-get-attribute xml-get-children link href :title xml-substitute-special xml-node-children title xml-get-attribute-or-nil "text" :description "html" "xhtml" prin1-to-string format "Unknown '%s' content."] 8 (#$ . 18426)])
(provide 'org-feed)

MMCT - 2023