feed2email 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +21 -10
 - data/README.md +138 -86
 - data/bin/f2e +6 -4
 - data/bin/feed2email +6 -4
 - data/bin/feed2email-migrate +23 -0
 - data/lib/feed2email.rb +6 -9
 - data/lib/feed2email/cli.rb +112 -75
 - data/lib/feed2email/config.rb +72 -52
 - data/lib/feed2email/core_ext.rb +10 -0
 - data/lib/feed2email/database.rb +75 -0
 - data/lib/feed2email/entry.rb +149 -15
 - data/lib/feed2email/feed.rb +111 -130
 - data/lib/feed2email/feed_autodiscoverer.rb +8 -10
 - data/lib/feed2email/migrate/convert_feeds_migration.rb +29 -0
 - data/lib/feed2email/migrate/feeds_import_migration.rb +42 -0
 - data/lib/feed2email/migrate/history_import_migration.rb +42 -0
 - data/lib/feed2email/migrate/migration.rb +42 -0
 - data/lib/feed2email/migrate/split_history_migration.rb +32 -0
 - data/lib/feed2email/open-uri.rb +7 -0
 - data/lib/feed2email/opml_exporter.rb +109 -0
 - data/lib/feed2email/opml_importer.rb +52 -0
 - data/lib/feed2email/redirection_checker.rb +2 -2
 - data/lib/feed2email/smtp_connection.rb +59 -0
 - data/lib/feed2email/version.rb +1 -1
 - metadata +55 -30
 - data/bin/feed2email-migrate-feedlist +0 -36
 - data/bin/feed2email-migrate-history +0 -29
 - data/lib/feed2email/feed_history.rb +0 -82
 - data/lib/feed2email/feed_list.rb +0 -147
 - data/lib/feed2email/lazy_smtp_connection.rb +0 -35
 - data/lib/feed2email/mail.rb +0 -84
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e90ae1ad818a1966844926f7653f068a284a13d3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1f6ed9ac284fc677ca57d89cbcbf6a29543a1a19
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7654f7a35ae49c97c79e39b4141d0e2ef52aa952db6c953a4d31550ea50606937ff3c862b94617e1132e64fd42c82ab84dadceb7dfbadc43e6b5a852acdb44e9
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 685064935abc8fbe1a6ec02be6fb2223dfdf7d8ed192cc1262839650f1f61538e6f760c90bb368f298fdb0127e5e9c895dcb08c01bd539993b5ccc703daa0a1e
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,15 +1,26 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ### 0.9.0
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            * Change data backend from YAML to SQLite3
         
     | 
| 
      
 4 
     | 
    
         
            +
            * Add `send_method` config option to send emails with
         
     | 
| 
      
 5 
     | 
    
         
            +
            * Add `file` send method for writing emails to a file
         
     | 
| 
      
 6 
     | 
    
         
            +
            * Add `backend` command to open an SQLite3 db shell
         
     | 
| 
      
 7 
     | 
    
         
            +
            * Add `config` command to open config with `$EDITOR`
         
     | 
| 
      
 8 
     | 
    
         
            +
            * Add `import`/`export` command to import/export feed subscriptions as OPML
         
     | 
| 
      
 9 
     | 
    
         
            +
            * Remove `history` command
         
     | 
| 
      
 10 
     | 
    
         
            +
            * Provide a single script for migrating (`feed2email-migrate`)
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
       1 
12 
     | 
    
         
             
            ### 0.8.0
         
     | 
| 
       2 
13 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            * Command-line interface for managing feeds 
     | 
| 
       4 
     | 
    
         
            -
            * Perform feed autodiscovery in `add` command 
     | 
| 
       5 
     | 
    
         
            -
            * Store feed metadata in feed list, so no more feed files 
     | 
| 
       6 
     | 
    
         
            -
            * Add `f2e` symlink to `feed2email` binary for running convenience 
     | 
| 
       7 
     | 
    
         
            -
            * Improve send delay between entry processing 
     | 
| 
       8 
     | 
    
         
            -
            * Fix feed fetching exception handling 
     | 
| 
       9 
     | 
    
         
            -
            * Sync feed metadata only if all entries are processed 
     | 
| 
       10 
     | 
    
         
            -
            * Record entry to history only if email was sent 
     | 
| 
       11 
     | 
    
         
            -
            * Always fetch feed when permanently redirected 
     | 
| 
       12 
     | 
    
         
            -
            * Ignore redirections to the same location 
     | 
| 
      
 14 
     | 
    
         
            +
            * Command-line interface for managing feeds
         
     | 
| 
      
 15 
     | 
    
         
            +
            * Perform feed autodiscovery in `add` command
         
     | 
| 
      
 16 
     | 
    
         
            +
            * Store feed metadata in feed list, so no more feed files
         
     | 
| 
      
 17 
     | 
    
         
            +
            * Add `f2e` symlink to `feed2email` binary for running convenience
         
     | 
| 
      
 18 
     | 
    
         
            +
            * Improve send delay between entry processing
         
     | 
| 
      
 19 
     | 
    
         
            +
            * Fix feed fetching exception handling
         
     | 
| 
      
 20 
     | 
    
         
            +
            * Sync feed metadata only if all entries are processed
         
     | 
| 
      
 21 
     | 
    
         
            +
            * Record entry to history only if email was sent
         
     | 
| 
      
 22 
     | 
    
         
            +
            * Always fetch feed when permanently redirected
         
     | 
| 
      
 23 
     | 
    
         
            +
            * Ignore redirections to the same location
         
     | 
| 
       13 
24 
     | 
    
         
             
            * Major rewrite of README file with new instructions
         
     | 
| 
       14 
25 
     | 
    
         | 
| 
       15 
26 
     | 
    
         
             
            ### 0.7.0
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -9,13 +9,18 @@ to be simple, fast and easy to use. 
     | 
|
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
            ## Features
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            *  
     | 
| 
       13 
     | 
    
         
            -
            * Feed fetching caching
         
     | 
| 
       14 
     | 
    
         
            -
            * Feed autodiscovery
         
     | 
| 
       15 
     | 
    
         
            -
            *  
     | 
| 
      
 12 
     | 
    
         
            +
            * Command-line feed management (add, remove, enable/disable)
         
     | 
| 
      
 13 
     | 
    
         
            +
            * Feed fetching caching (_Last-Modified_ and _ETag_ HTTP headers)
         
     | 
| 
      
 14 
     | 
    
         
            +
            * [Feed autodiscovery](http://www.rssboard.org/rss-autodiscovery)
         
     | 
| 
      
 15 
     | 
    
         
            +
            * [OPML][] import/export of feed subscriptions
         
     | 
| 
      
 16 
     | 
    
         
            +
            * Email sending with SMTP, [Sendmail][] (or compatible [MTA][]) or by writing to
         
     | 
| 
      
 17 
     | 
    
         
            +
              a file
         
     | 
| 
       16 
18 
     | 
    
         
             
            * _text/html_ and _text/plain_ (Markdown) multipart emails
         
     | 
| 
       17 
     | 
    
         
            -
            *  
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
            * Permanent redirection support for feed URLs
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            [OPML]: http://en.wikipedia.org/wiki/OPML
         
     | 
| 
      
 22 
     | 
    
         
            +
            [Sendmail]: http://en.wikipedia.org/wiki/Sendmail
         
     | 
| 
      
 23 
     | 
    
         
            +
            [MTA]: http://en.wikipedia.org/wiki/Message_transfer_agent
         
     | 
| 
       19 
24 
     | 
    
         | 
| 
       20 
25 
     | 
    
         
             
            ## Installation
         
     | 
| 
       21 
26 
     | 
    
         | 
| 
         @@ -25,22 +30,46 @@ As a [gem][] from [RubyGems][]: 
     | 
|
| 
       25 
30 
     | 
    
         
             
            $ gem install feed2email
         
     | 
| 
       26 
31 
     | 
    
         
             
            ~~~
         
     | 
| 
       27 
32 
     | 
    
         | 
| 
      
 33 
     | 
    
         
            +
            If the above command fails due to missing headers, make sure the following
         
     | 
| 
      
 34 
     | 
    
         
            +
            packages for [curb][] and [sqlite3][] gems are installed:
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
            ~~~ sh
         
     | 
| 
      
 37 
     | 
    
         
            +
            $ sudo apt-get install libcurl4-openssl-dev libsqlite3-dev
         
     | 
| 
      
 38 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
            **Warning:** If you are updating from an earlier version of feed2email, make
         
     | 
| 
      
 41 
     | 
    
         
            +
            sure you run `feed2email-migrate` to migrate its data before using it.
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
       28 
43 
     | 
    
         
             
            [gem]: http://rubygems.org/gems/feed2email
         
     | 
| 
       29 
44 
     | 
    
         
             
            [RubyGems]: http://rubygems.org/
         
     | 
| 
      
 45 
     | 
    
         
            +
            [curb]: https://rubygems.org/gems/curb
         
     | 
| 
      
 46 
     | 
    
         
            +
            [sqlite3]: https://rubygems.org/gems/sqlite3
         
     | 
| 
       30 
47 
     | 
    
         | 
| 
       31 
48 
     | 
    
         
             
            ## Configuration
         
     | 
| 
       32 
49 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
            Through a [YAML][] file  
     | 
| 
      
 50 
     | 
    
         
            +
            Through a [YAML][] file at `~/.feed2email/config.yml`.
         
     | 
| 
       34 
51 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
      
 52 
     | 
    
         
            +
            Edit it with the `config` command:
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
            ~~~ sh
         
     | 
| 
      
 55 
     | 
    
         
            +
            $ # same as "f2e c"
         
     | 
| 
      
 56 
     | 
    
         
            +
            $ feed2email config
         
     | 
| 
      
 57 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
            **Note:** The command will fail if the `EDITOR` environmental variable is not
         
     | 
| 
      
 60 
     | 
    
         
            +
            set.
         
     | 
| 
       36 
61 
     | 
    
         | 
| 
       37 
62 
     | 
    
         
             
            Each line in the configuration file contains a key-value pair. Each key-value
         
     | 
| 
       38 
63 
     | 
    
         
             
            pair is separated with a colon, e.g.: `foo: bar`
         
     | 
| 
       39 
64 
     | 
    
         | 
| 
      
 65 
     | 
    
         
            +
            [YAML]: http://en.wikipedia.org/wiki/YAML
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
       40 
67 
     | 
    
         
             
            ### General options
         
     | 
| 
       41 
68 
     | 
    
         | 
| 
       42 
69 
     | 
    
         
             
            * `recipient` (required) is the email address to send email to
         
     | 
| 
       43 
70 
     | 
    
         
             
            * `sender` (required) is the email address to send email from (can be any)
         
     | 
| 
      
 71 
     | 
    
         
            +
            * `send_method` (optional) is the method to send email with and can be `file`
         
     | 
| 
      
 72 
     | 
    
         
            +
              (default), `sendmail` or `smtp`
         
     | 
| 
       44 
73 
     | 
    
         
             
            * `send_delay` (optional) is the number of seconds to wait between each email to
         
     | 
| 
       45 
74 
     | 
    
         
             
              avoid SMTP server throttling errors (default is `10`; use `0` to disable)
         
     | 
| 
       46 
75 
     | 
    
         
             
            * `max_entries` (optional) is the maximum number of entries to process per feed
         
     | 
| 
         @@ -51,7 +80,7 @@ pair is separated with a colon, e.g.: `foo: bar` 
     | 
|
| 
       51 
80 
     | 
    
         
             
            * `log_path` (optional) is the _absolute_ path to the log file (default is
         
     | 
| 
       52 
81 
     | 
    
         
             
              `true` which logs to standard output; use `false` to disable logging)
         
     | 
| 
       53 
82 
     | 
    
         
             
            * `log_level` (optional) is the logging verbosity level and can be `fatal`
         
     | 
| 
       54 
     | 
    
         
            -
              (least verbose), `error`, `warn`, `info` (default)  
     | 
| 
      
 83 
     | 
    
         
            +
              (least verbose), `error`, `warn`, `info` (default) or `debug` (most verbose)
         
     | 
| 
       55 
84 
     | 
    
         
             
            * `log_shift_age` (optional) is the number of _old_ log files to keep or the
         
     | 
| 
       56 
85 
     | 
    
         
             
              frequency of rotation (`daily`, `weekly`, `monthly`; default is `0` so only
         
     | 
| 
       57 
86 
     | 
    
         
             
              the current log file is kept)
         
     | 
| 
         @@ -59,12 +88,26 @@ pair is separated with a colon, e.g.: `foo: bar` 
     | 
|
| 
       59 
88 
     | 
    
         
             
              only applies when `log_shift_age` is a number greater than zero (default is
         
     | 
| 
       60 
89 
     | 
    
         
             
              `1`)
         
     | 
| 
       61 
90 
     | 
    
         | 
| 
       62 
     | 
    
         
            -
            ###  
     | 
| 
      
 91 
     | 
    
         
            +
            ### Sending options
         
     | 
| 
       63 
92 
     | 
    
         | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
            contains options for both, feed2email will use SMTP.
         
     | 
| 
      
 93 
     | 
    
         
            +
            #### File
         
     | 
| 
       66 
94 
     | 
    
         | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
      
 95 
     | 
    
         
            +
            This method simply writes emails to a file (named after the `recipient` config
         
     | 
| 
      
 96 
     | 
    
         
            +
            option) in a path that you specify.
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
            * `mail_path` (optional) is the path to write emails in (default is `~/Mail/`)
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
            #### Sendmail
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
            For this method you need to have [Sendmail][] or an [MTA][] with a
         
     | 
| 
      
 103 
     | 
    
         
            +
            Sendmail-compatible interface (e.g. [msmtp][], [Postfix][]) set up and working
         
     | 
| 
      
 104 
     | 
    
         
            +
            in your system.
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
            * `sendmail_path` (optional) is the path to the Sendmail binary (default is
         
     | 
| 
      
 107 
     | 
    
         
            +
              `/usr/sbin/sendmail`)
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
            [msmtp]: http://msmtp.sourceforge.net/
         
     | 
| 
      
 110 
     | 
    
         
            +
            [Postfix]: http://en.wikipedia.org/wiki/Postfix_(software)
         
     | 
| 
       68 
111 
     | 
    
         | 
| 
       69 
112 
     | 
    
         
             
            #### SMTP
         
     | 
| 
       70 
113 
     | 
    
         | 
| 
         @@ -88,145 +131,154 @@ To set the correct permissions, issue `chmod 600 ~/.feed2email/config.yml`. 
     | 
|
| 
       88 
131 
     | 
    
         | 
| 
       89 
132 
     | 
    
         
             
            [Mailgun]: http://www.mailgun.com/
         
     | 
| 
       90 
133 
     | 
    
         | 
| 
       91 
     | 
    
         
            -
            #### MTA
         
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
       93 
     | 
    
         
            -
            For this method you need to have an [MTA][] with a [Sendmail][]-compatible
         
     | 
| 
       94 
     | 
    
         
            -
            interface set up and working in your system like [msmtp][] or [Postfix][].
         
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
            * `sendmail_path` (optional) is the path to the Sendmail binary (default is
         
     | 
| 
       97 
     | 
    
         
            -
              `/usr/sbin/sendmail`)
         
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
     | 
    
         
            -
            [Sendmail]: http://en.wikipedia.org/wiki/Sendmail
         
     | 
| 
       100 
     | 
    
         
            -
            [msmtp]: http://msmtp.sourceforge.net/
         
     | 
| 
       101 
     | 
    
         
            -
            [Postfix]: http://en.wikipedia.org/wiki/Postfix_(software)
         
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
134 
     | 
    
         
             
            ## Use
         
     | 
| 
       104 
135 
     | 
    
         | 
| 
       105 
136 
     | 
    
         
             
            ### Managing feeds
         
     | 
| 
       106 
137 
     | 
    
         | 
| 
       107 
     | 
    
         
            -
             
     | 
| 
      
 138 
     | 
    
         
            +
            Add some feeds:
         
     | 
| 
       108 
139 
     | 
    
         | 
| 
       109 
140 
     | 
    
         
             
            ~~~ sh
         
     | 
| 
       110 
     | 
    
         
            -
            $ feed2email add https://github.com/agorf.atom
         
     | 
| 
       111 
     | 
    
         
            -
            Added feed https://github.com/agorf.atom at index 0
         
     | 
| 
       112 
141 
     | 
    
         
             
            $ feed2email add https://github.com/agorf/feed2email/commits.atom
         
     | 
| 
       113 
     | 
    
         
            -
            Added feed https://github.com/agorf/feed2email/commits.atom 
     | 
| 
      
 142 
     | 
    
         
            +
            Added feed:   1 https://github.com/agorf/feed2email/commits.atom
         
     | 
| 
      
 143 
     | 
    
         
            +
            $ # same as "feed2email add https://github.com/agorf.atom"
         
     | 
| 
      
 144 
     | 
    
         
            +
            $ f2e a https://github.com/agorf.atom
         
     | 
| 
      
 145 
     | 
    
         
            +
            Added feed:   2 https://github.com/agorf.atom
         
     | 
| 
       114 
146 
     | 
    
         
             
            ~~~
         
     | 
| 
       115 
147 
     | 
    
         | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
            there is no other command beginning with an `l`.
         
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
            It is also possible to pass a website URL and let feed2email autodiscover any
         
     | 
| 
       121 
     | 
    
         
            -
            feeds:
         
     | 
| 
      
 148 
     | 
    
         
            +
            Passing a website URL to the `add` command will have feed2email autodiscover any
         
     | 
| 
      
 149 
     | 
    
         
            +
            feeds in that page:
         
     | 
| 
       122 
150 
     | 
    
         | 
| 
       123 
151 
     | 
    
         
             
            ~~~ sh
         
     | 
| 
       124 
     | 
    
         
            -
            $  
     | 
| 
      
 152 
     | 
    
         
            +
            $ f2e add http://www.rubyinside.com/
         
     | 
| 
       125 
153 
     | 
    
         
             
            0: http://www.rubyinside.com/feed/ "Ruby Inside" (application/rss+xml)
         
     | 
| 
       126 
154 
     | 
    
         
             
            Please enter a feed to subscribe to: 0
         
     | 
| 
       127 
     | 
    
         
            -
            Added feed http://www.rubyinside.com/feed/ 
     | 
| 
       128 
     | 
    
         
            -
            $  
     | 
| 
      
 155 
     | 
    
         
            +
            Added feed:   3 http://www.rubyinside.com/feed/
         
     | 
| 
      
 156 
     | 
    
         
            +
            $ f2e add http://thechangelog.com/137/
         
     | 
| 
       129 
157 
     | 
    
         
             
            0: http://thechangelog.com/137/feed/ "The Changelog » #137: Better GitHub Issues with HuBoard and Ryan Rauh Comments Feed" (application/rss+xml)
         
     | 
| 
       130 
158 
     | 
    
         
             
            1: http://thechangelog.com/feed/ "RSS 2.0 Feed" (application/rss+xml)
         
     | 
| 
       131 
159 
     | 
    
         
             
            Please enter a feed to subscribe to: 1
         
     | 
| 
       132 
     | 
    
         
            -
            Added feed http://thechangelog.com/feed/ 
     | 
| 
       133 
     | 
    
         
            -
            $  
     | 
| 
      
 160 
     | 
    
         
            +
            Added feed:   4 http://thechangelog.com/feed/
         
     | 
| 
      
 161 
     | 
    
         
            +
            $ # cancel autodiscovery by pressing Ctrl-C
         
     | 
| 
      
 162 
     | 
    
         
            +
            $ f2e add http://thechangelog.com/137/
         
     | 
| 
       134 
163 
     | 
    
         
             
            0: http://thechangelog.com/137/feed/ "The Changelog » #137: Better GitHub Issues with HuBoard and Ryan Rauh Comments Feed" (application/rss+xml)
         
     | 
| 
       135 
164 
     | 
    
         
             
            Please enter a feed to subscribe to: ^C
         
     | 
| 
       136 
165 
     | 
    
         
             
            ~~~
         
     | 
| 
       137 
166 
     | 
    
         | 
| 
       138 
     | 
    
         
            -
            Note  
     | 
| 
       139 
     | 
    
         
            -
             
     | 
| 
       140 
     | 
    
         
            -
            Autodiscovery is then cancelled by pressing `Ctrl-C`.
         
     | 
| 
      
 167 
     | 
    
         
            +
            **Note:** When autodiscovering feeds, feed2email lists only those that don't
         
     | 
| 
      
 168 
     | 
    
         
            +
            already exist in your feed subscriptions.
         
     | 
| 
       141 
169 
     | 
    
         | 
| 
       142 
170 
     | 
    
         
             
            The feed list so far:
         
     | 
| 
       143 
171 
     | 
    
         | 
| 
       144 
172 
     | 
    
         
             
            ~~~ sh
         
     | 
| 
      
 173 
     | 
    
         
            +
            $ # same as "f2e l"
         
     | 
| 
       145 
174 
     | 
    
         
             
            $ feed2email list
         
     | 
| 
       146 
     | 
    
         
            -
             
     | 
| 
       147 
     | 
    
         
            -
             
     | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
      
 175 
     | 
    
         
            +
              1 https://github.com/agorf/feed2email/commits.atom
         
     | 
| 
      
 176 
     | 
    
         
            +
              2 https://github.com/agorf.atom
         
     | 
| 
      
 177 
     | 
    
         
            +
              3 http://www.rubyinside.com/feed/
         
     | 
| 
      
 178 
     | 
    
         
            +
              4 http://thechangelog.com/feed/
         
     | 
| 
       150 
179 
     | 
    
         
             
            ~~~
         
     | 
| 
       151 
180 
     | 
    
         | 
| 
       152 
     | 
    
         
            -
             
     | 
| 
       153 
     | 
    
         
            -
             
     | 
| 
      
 181 
     | 
    
         
            +
            A feed can be disabled so that it is not processed when `feed2email process`
         
     | 
| 
      
 182 
     | 
    
         
            +
            runs with the `toggle` command:
         
     | 
| 
       154 
183 
     | 
    
         | 
| 
       155 
184 
     | 
    
         
             
            ~~~ sh
         
     | 
| 
      
 185 
     | 
    
         
            +
            $ # same as "f2e t 1"
         
     | 
| 
       156 
186 
     | 
    
         
             
            $ feed2email toggle 1
         
     | 
| 
       157 
     | 
    
         
            -
             
     | 
| 
       158 
     | 
    
         
            -
            $ feed2email list
         
     | 
| 
       159 
     | 
    
         
            -
            0: https://github.com/agorf.atom
         
     | 
| 
       160 
     | 
    
         
            -
            1: DISABLED https://github.com/agorf/feed2email/commits.atom
         
     | 
| 
       161 
     | 
    
         
            -
            2: http://www.rubyinside.com/feed/
         
     | 
| 
       162 
     | 
    
         
            -
            3: http://thechangelog.com/feed/
         
     | 
| 
      
 187 
     | 
    
         
            +
            Toggled feed:   1 DISABLED https://github.com/agorf/feed2email/commits.atom
         
     | 
| 
       163 
188 
     | 
    
         
             
            ~~~
         
     | 
| 
       164 
189 
     | 
    
         | 
| 
       165 
     | 
    
         
            -
            It  
     | 
| 
      
 190 
     | 
    
         
            +
            It can be enabled with the `toggle` command again:
         
     | 
| 
       166 
191 
     | 
    
         | 
| 
       167 
192 
     | 
    
         
             
            ~~~ sh
         
     | 
| 
      
 193 
     | 
    
         
            +
            $ # same as "feed2email toggle 1"
         
     | 
| 
      
 194 
     | 
    
         
            +
            $ f2e t 1
         
     | 
| 
      
 195 
     | 
    
         
            +
            Toggled feed:   1 https://github.com/agorf/feed2email/commits.atom
         
     | 
| 
      
 196 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 197 
     | 
    
         
            +
             
     | 
| 
      
 198 
     | 
    
         
            +
            It can also be removed from feed subscriptions permanently:
         
     | 
| 
      
 199 
     | 
    
         
            +
             
     | 
| 
      
 200 
     | 
    
         
            +
            ~~~ sh
         
     | 
| 
      
 201 
     | 
    
         
            +
            $ # same as "f2e r 1"
         
     | 
| 
       168 
202 
     | 
    
         
             
            $ feed2email remove 1
         
     | 
| 
       169 
     | 
    
         
            -
            Removed feed  
     | 
| 
       170 
     | 
    
         
            -
            Warning: Feed list indices have changed!
         
     | 
| 
      
 203 
     | 
    
         
            +
            Removed feed:   1 https://github.com/agorf/feed2email/commits.atom
         
     | 
| 
       171 
204 
     | 
    
         
             
            ~~~
         
     | 
| 
       172 
205 
     | 
    
         | 
| 
       173 
     | 
    
         
            -
             
     | 
| 
      
 206 
     | 
    
         
            +
            ### Migrating to/from feed2email
         
     | 
| 
       174 
207 
     | 
    
         | 
| 
       175 
     | 
    
         
            -
             
     | 
| 
       176 
     | 
    
         
            -
             
     | 
| 
       177 
     | 
    
         
            -
            at index 2 is now at index 1 and the feed at index 3 is now at index 2.
         
     | 
| 
      
 208 
     | 
    
         
            +
            feed2email supports importing and exporting feed subscriptions as [OPML][]. This
         
     | 
| 
      
 209 
     | 
    
         
            +
            makes it easy to migrate to and away from feed2email anytime you want.
         
     | 
| 
       178 
210 
     | 
    
         | 
| 
       179 
     | 
    
         
            -
             
     | 
| 
      
 211 
     | 
    
         
            +
            Export feed subscriptions to `feeds.xml`:
         
     | 
| 
       180 
212 
     | 
    
         | 
| 
       181 
213 
     | 
    
         
             
            ~~~ sh
         
     | 
| 
       182 
     | 
    
         
            -
            $  
     | 
| 
       183 
     | 
    
         
            -
             
     | 
| 
       184 
     | 
    
         
            -
             
     | 
| 
       185 
     | 
    
         
            -
             
     | 
| 
      
 214 
     | 
    
         
            +
            $ # same as "f2e e feeds.xml"
         
     | 
| 
      
 215 
     | 
    
         
            +
            $ feed2email export feeds.xml
         
     | 
| 
      
 216 
     | 
    
         
            +
            This may take a bit. Please wait...
         
     | 
| 
      
 217 
     | 
    
         
            +
            Exported 3 feed subscriptions to feeds.xml
         
     | 
| 
      
 218 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 219 
     | 
    
         
            +
             
     | 
| 
      
 220 
     | 
    
         
            +
            Import feed subscriptions from `feeds.xml`:
         
     | 
| 
      
 221 
     | 
    
         
            +
             
     | 
| 
      
 222 
     | 
    
         
            +
            ~~~ sh
         
     | 
| 
      
 223 
     | 
    
         
            +
            $ # same as "f2e i feeds.xml"
         
     | 
| 
      
 224 
     | 
    
         
            +
            $ feed2email import feeds.xml
         
     | 
| 
      
 225 
     | 
    
         
            +
            Importing...
         
     | 
| 
      
 226 
     | 
    
         
            +
            Feed already exists:   2 https://github.com/agorf.atom
         
     | 
| 
      
 227 
     | 
    
         
            +
            Feed already exists:   3 http://www.rubyinside.com/feed/
         
     | 
| 
      
 228 
     | 
    
         
            +
            Feed already exists:   4 http://thechangelog.com/feed/
         
     | 
| 
       186 
229 
     | 
    
         
             
            ~~~
         
     | 
| 
       187 
230 
     | 
    
         | 
| 
       188 
     | 
    
         
            -
             
     | 
| 
       189 
     | 
    
         
            -
             
     | 
| 
       190 
     | 
    
         
            -
             
     | 
| 
      
 231 
     | 
    
         
            +
            Nothing was imported since all feeds already exist. Let's remove them first and
         
     | 
| 
      
 232 
     | 
    
         
            +
            then try again:
         
     | 
| 
      
 233 
     | 
    
         
            +
             
     | 
| 
      
 234 
     | 
    
         
            +
            ~~~ sh
         
     | 
| 
      
 235 
     | 
    
         
            +
            $ f2e r 2
         
     | 
| 
      
 236 
     | 
    
         
            +
            Removed feed:   2 https://github.com/agorf.atom
         
     | 
| 
      
 237 
     | 
    
         
            +
            $ f2e r 3
         
     | 
| 
      
 238 
     | 
    
         
            +
            Removed feed:   3 http://www.rubyinside.com/feed/
         
     | 
| 
      
 239 
     | 
    
         
            +
            $ f2e r 4
         
     | 
| 
      
 240 
     | 
    
         
            +
            Removed feed:   4 http://thechangelog.com/feed/
         
     | 
| 
      
 241 
     | 
    
         
            +
            $ f2e l
         
     | 
| 
      
 242 
     | 
    
         
            +
            No feeds
         
     | 
| 
      
 243 
     | 
    
         
            +
            $ feed2email import feeds.xml
         
     | 
| 
      
 244 
     | 
    
         
            +
            Importing...
         
     | 
| 
      
 245 
     | 
    
         
            +
            Imported feed:   1 https://github.com/agorf.atom
         
     | 
| 
      
 246 
     | 
    
         
            +
            Imported feed:   2 http://www.rubyinside.com/feed/
         
     | 
| 
      
 247 
     | 
    
         
            +
            Imported feed:   3 http://thechangelog.com/feed/
         
     | 
| 
      
 248 
     | 
    
         
            +
            Imported 3 feed subscriptions from feeds.xml
         
     | 
| 
      
 249 
     | 
    
         
            +
            ~~~
         
     | 
| 
       191 
250 
     | 
    
         | 
| 
       192 
251 
     | 
    
         
             
            ### Running
         
     | 
| 
       193 
252 
     | 
    
         | 
| 
       194 
253 
     | 
    
         
             
            ~~~ sh
         
     | 
| 
      
 254 
     | 
    
         
            +
            $ # same as "f2e p"
         
     | 
| 
       195 
255 
     | 
    
         
             
            $ feed2email process
         
     | 
| 
       196 
256 
     | 
    
         
             
            ~~~
         
     | 
| 
       197 
257 
     | 
    
         | 
| 
       198 
258 
     | 
    
         
             
            When run, feed2email will go through your feed list, fetch each feed (if
         
     | 
| 
       199 
     | 
    
         
            -
            necessary) and send an email for each new entry.  
     | 
| 
      
 259 
     | 
    
         
            +
            necessary) and send an email for each new entry. Output is logged to the
         
     | 
| 
       200 
260 
     | 
    
         
             
            standard output, unless configured otherwise.
         
     | 
| 
       201 
261 
     | 
    
         | 
| 
       202 
     | 
    
         
            -
            **Warning:** Prior to version 0.8.0 where a command-line interface was
         
     | 
| 
       203 
     | 
    
         
            -
            introduced, the way to run feed2email was simply `feed2email`. Now this will
         
     | 
| 
       204 
     | 
    
         
            -
            just print helpful text on how to use it.
         
     | 
| 
       205 
     | 
    
         
            -
             
     | 
| 
       206 
262 
     | 
    
         
             
            When a new feed is detected (which is the case when feed2email runs for the
         
     | 
| 
       207 
263 
     | 
    
         
             
            first time on your feed list), all of its entries are skipped and no email is
         
     | 
| 
       208 
264 
     | 
    
         
             
            sent. This is so that you don't get spammed when you add a feed for the first
         
     | 
| 
       209 
265 
     | 
    
         
             
            time.
         
     | 
| 
       210 
266 
     | 
    
         | 
| 
       211 
     | 
    
         
            -
            If you want to receive a specific entry from a newly added feed, edit the feed's
         
     | 
| 
       212 
     | 
    
         
            -
            history file with `feed2email history` and remove the entry. Then issue
         
     | 
| 
       213 
     | 
    
         
            -
            `feed2email fetch` to clear the feed's fetch cache. Next time
         
     | 
| 
       214 
     | 
    
         
            -
            `feed2email process` runs, the entry will be treated as new and will be
         
     | 
| 
       215 
     | 
    
         
            -
            processed.
         
     | 
| 
       216 
     | 
    
         
            -
             
     | 
| 
       217 
267 
     | 
    
         
             
            ### Getting help
         
     | 
| 
       218 
268 
     | 
    
         | 
| 
       219 
     | 
    
         
            -
            Issue `feed2email` or `feed2email  
     | 
| 
       220 
     | 
    
         
            -
            to use feed2email.
         
     | 
| 
      
 269 
     | 
    
         
            +
            Issue `feed2email help` (`f2e h`) or just `feed2email` (`f2e`) at any point to
         
     | 
| 
      
 270 
     | 
    
         
            +
            get helpful text on how to use feed2email.
         
     | 
| 
       221 
271 
     | 
    
         | 
| 
       222 
272 
     | 
    
         
             
            ## Contributing
         
     | 
| 
       223 
273 
     | 
    
         | 
| 
       224 
     | 
    
         
            -
            Using feed2email and want to help?  
     | 
| 
       225 
     | 
    
         
            -
             
     | 
| 
      
 274 
     | 
    
         
            +
            Using feed2email and want to help? [Let me know](http://agorf.gr/) how you use
         
     | 
| 
      
 275 
     | 
    
         
            +
            it and if you have any ideas on how to improve it.
         
     | 
| 
       226 
276 
     | 
    
         | 
| 
       227 
277 
     | 
    
         
             
            ## License
         
     | 
| 
       228 
278 
     | 
    
         | 
| 
       229 
     | 
    
         
            -
            Licensed under the MIT license (see  
     | 
| 
      
 279 
     | 
    
         
            +
            Licensed under the MIT license (see [LICENSE.txt][license]).
         
     | 
| 
      
 280 
     | 
    
         
            +
             
     | 
| 
      
 281 
     | 
    
         
            +
            [license]: https://github.com/agorf/feed2email/blob/master/LICENSE.txt
         
     | 
| 
       230 
282 
     | 
    
         | 
| 
       231 
283 
     | 
    
         
             
            ## Author
         
     | 
| 
       232 
284 
     | 
    
         | 
    
        data/bin/f2e
    CHANGED
    
    | 
         @@ -1,9 +1,11 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            else
         
     | 
| 
      
 3 
     | 
    
         
            +
            LOCK_FILE = '/tmp/feed2email.lock'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            unless File.new(LOCK_FILE, 'w').flock(File::LOCK_NB | File::LOCK_EX)
         
     | 
| 
       7 
6 
     | 
    
         
             
              abort 'An instance of feed2email is already running. Exiting...'
         
     | 
| 
       8 
7 
     | 
    
         
             
            end
         
     | 
| 
       9 
8 
     | 
    
         | 
| 
      
 9 
     | 
    
         
            +
            require 'feed2email/cli'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            Feed2Email::Cli.start(ARGV)
         
     | 
    
        data/bin/feed2email
    CHANGED
    
    | 
         @@ -1,9 +1,11 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            else
         
     | 
| 
      
 3 
     | 
    
         
            +
            LOCK_FILE = '/tmp/feed2email.lock'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            unless File.new(LOCK_FILE, 'w').flock(File::LOCK_NB | File::LOCK_EX)
         
     | 
| 
       7 
6 
     | 
    
         
             
              abort 'An instance of feed2email is already running. Exiting...'
         
     | 
| 
       8 
7 
     | 
    
         
             
            end
         
     | 
| 
       9 
8 
     | 
    
         | 
| 
      
 9 
     | 
    
         
            +
            require 'feed2email/cli'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            Feed2Email::Cli.start(ARGV)
         
     | 
| 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'feed2email/migrate/convert_feeds_migration'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'feed2email/migrate/feeds_import_migration'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'feed2email/migrate/history_import_migration'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'feed2email/migrate/split_history_migration'
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            include Feed2Email::Migrate
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            [
         
     | 
| 
      
 11 
     | 
    
         
            +
              SplitHistoryMigration,
         
     | 
| 
      
 12 
     | 
    
         
            +
              ConvertFeedsMigration,
         
     | 
| 
      
 13 
     | 
    
         
            +
              FeedsImportMigration,
         
     | 
| 
      
 14 
     | 
    
         
            +
              HistoryImportMigration
         
     | 
| 
      
 15 
     | 
    
         
            +
            ].each do |klass|
         
     | 
| 
      
 16 
     | 
    
         
            +
              if klass.new.apply
         
     | 
| 
      
 17 
     | 
    
         
            +
                print 'Applied '
         
     | 
| 
      
 18 
     | 
    
         
            +
              else
         
     | 
| 
      
 19 
     | 
    
         
            +
                print 'Skipped '
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
              puts klass.to_s
         
     | 
| 
      
 23 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/feed2email.rb
    CHANGED
    
    | 
         @@ -1,17 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'pathname'
         
     | 
| 
       1 
2 
     | 
    
         
             
            require 'feed2email/config'
         
     | 
| 
       2 
     | 
    
         
            -
            require 'feed2email/feed_list'
         
     | 
| 
       3 
     | 
    
         
            -
            require 'feed2email/lazy_smtp_connection'
         
     | 
| 
       4 
3 
     | 
    
         
             
            require 'feed2email/logger'
         
     | 
| 
       5 
4 
     | 
    
         | 
| 
       6 
5 
     | 
    
         
             
            module Feed2Email
         
     | 
| 
       7 
     | 
    
         
            -
              CONFIG_DIR = File.join(ENV['HOME'], '.feed2email')
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
6 
     | 
    
         
             
              def self.config
         
     | 
| 
       10 
     | 
    
         
            -
                @config ||= Config.new( 
     | 
| 
      
 7 
     | 
    
         
            +
                @config ||= Config.new(config_path)
         
     | 
| 
       11 
8 
     | 
    
         
             
              end
         
     | 
| 
       12 
9 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
              def self. 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
      
 10 
     | 
    
         
            +
              def self.config_path
         
     | 
| 
      
 11 
     | 
    
         
            +
                root.join('config.yml').to_s
         
     | 
| 
       15 
12 
     | 
    
         
             
              end
         
     | 
| 
       16 
13 
     | 
    
         | 
| 
       17 
14 
     | 
    
         
             
              def self.logger
         
     | 
| 
         @@ -21,7 +18,7 @@ module Feed2Email 
     | 
|
| 
       21 
18 
     | 
    
         
             
                ).logger
         
     | 
| 
       22 
19 
     | 
    
         
             
              end
         
     | 
| 
       23 
20 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
              def self. 
     | 
| 
       25 
     | 
    
         
            -
                @ 
     | 
| 
      
 21 
     | 
    
         
            +
              def self.root
         
     | 
| 
      
 22 
     | 
    
         
            +
                @root ||= Pathname.new(ENV['HOME']).join('.feed2email')
         
     | 
| 
       26 
23 
     | 
    
         
             
              end
         
     | 
| 
       27 
24 
     | 
    
         
             
            end
         
     |