3.2.1 title Rules

“title rules” are rules that are matched against each entry’s title. You may match by substring, regexp or whole word. The match may be case sensitive or case-insensitive. Of course, the rule needs to specify the amount to be added to an entry’s score on successful match.

In the score file (see The Score File), title rules are represented by a property list of up to seven attributes:

  1. :text: The match text.
  2. :value: The match value. This is an integer specifying the amount by which the entry’s score should be adjusted, should the text match
  3. :type: The match type.

    This is a symbol, and must be one of s, S, r, R, w or W for case-insensitive substring match, case-sensitive substring match, case-insensitive regexp match or case-sensitive regexp match, and case-insensitive or case-sensitive whole word match, respectively.

    Note that regular expressions use Emacs Lisp regular expression syntax (see Regular Expressions in Emacs Lisp).

    Whole word matching just feeds the match text to word-search-regexp (see String Search in Emacs Lisp) before doing a regexp search.

  4. :date: Last match time.

    The last time this rule matched an entry, in seconds since Unix epoch. When defining rules, this element & all those following are optional & need not be supplied by the score file author. This field will be automatically kept up-to-date by elfeed-score.

  5. :tags: Tag scoping rules.

    You may wish to apply this rule only to entries that have certain tags (or that do not have certain tags). See Scoping Rules by Tags for how to do that.

    This property is optional.

  6. :hits: Hit count.

    The number of times this rule has matched an entry. This field will be automatically kept up-to-date by elfeed-score.

  7. :feeds: Feed scoping rules.

    You may wish to apply this rule only to entries that came from certain feeds (or did not come from certain feeds). See Scoping Rules by Feed for how to do that.

    This property is optional.

So, for instance, the following rule:

("title"
  (:text "rust.*who.s hiring" :value 1500 :type r))

would match each entry’s title against the regular expression “rust.*who.s hiring” (without regard to case) and adds 1500 to the score of any entry that matches.

Note that it takes advantage of the fact that only the :text, :value & :type properties are required.

After this rule has been running for some time, and the rule has been updated by elfeed-score, it will be written down in the score file as something like this:

("title"
  (:text "rust.*who.s hiring" :value 1500 :type r
  :date 1612278560.2936354 :hits 46))

The additional elements indicate that this was last matched at Tuesday, February 2, 2021 3:09:20.293 PM UTC & that it has matched forty-six entries since it was created. Note that since it is not scoped to any particular tags or to any particular feed(s), those properties are not recorded.