Where parallels cross

Interesting bits of life

How to fit RSS feeds into an org file

Introduction

Hello everyone!

It is a while I am thinking how to easy my job hunting approach, and by easy I mean to integrate it with the typical workflow I follow.

Currently I look for job through website like https://www.indeed.com/, and I typically input in the search box things like: "functional programming", "graduate software engineer", etc...

This is bothersome, and results in uris like: https://www.indeed.com/jobs?q=functional+programming&l=, https://www.indeed.com/jobs?q=graduate+software+engineer&l=, etc...

My workflow is completely based on Emacs and Org mode, and using Firefox or even Emacs' browser eww requires a lot of clicks and screens that I would like to avoid.

The discoveries

This could have meant adding these uris to my current feed reader, but I would still miss my Org mode integration!

This is where I remembered that Org mode can do feeds: http://orgmode.org/manual/RSS-Feeds.html.

The hack

At this point I needed to make the two discoveries work together with my workflow: I would like adding these feeds in my main Org file and reject the post I have already read.

Naturally all this is supported by Carsten's fantastic org-feed.el, but required a bit of diving into the code from which this post intends to save you.

So:

1 ) try the manual example:

(setq org-feed-alist
'(("Slashdot"
"/tmp/feeds.org" "Slashdot Entries")))

2 ) then edit the example to support your preferred websites:

(setq org-feed-alist
'(("functional-jobs"
"/tmp/feeds.org" "Functional Job Feeds"
)
)))

Cool, but wait! This creates an Org file /tmp/feeds.org with two new headings. Instead, I wanted to add this jobs into an existing file under a single heading "Jobs Feeds"

(setq org-feed-alist
'(("functional-jobs"
"/tmp/feeds.org" "Job Feeds"
)
"/tmp/feeds.org" "Job Feeds"
)))

Tragedy! Now when cannot recognize where the feeds come from and every time we reload the feeds they duplicate!!!

4 ) let's add a template to give an appropriate tag to the heading:

(defun my-for-org-feed/tag-template
"creates a org-feed template string with [tag] as Org header tag"
(tag)
(concat "\n* %h " tag " \nCreated: %U\nOriginal: %a \n\n%description \n\n"))

(setq org-feed-alist
(("functional-jobs";; NOTE the backquote!
"/tmp/feeds.org" "Functional Job Feeds"
:template ,(my-for-org-feed/tag-template ":clojure:uk:"))); and the comma!
)))

As you can see there is a backquote and a comma in the elisp source: in simple words the backquote allows you to choose which sexp must be evaluated (by placing before a comma).

5 ) finally, let's solve the duplication issue:

(defun my-for-org-feed/tag-template
"creates a org-feed template string with [tag] as Org header tag"
(tag)
(concat "\n* %h " tag " \nCreated: %U\nOriginal: %a \n\n%description \n\n"))

(setq org-feed-alist
(("functional-jobs"
"/tmp/feeds.org" "Functional Job Feeds"
:template ,(my-for-org-feed/tag-template ":clojure:uk:")
:drawer "functional-jobs"))