summaryrefslogtreecommitdiff
path: root/bin/feed2imap-opmlimport
blob: a097c16b6ed5d3965ae94324e5910155e0768540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/ruby

=begin
Feed2Imap - RSS/Atom Aggregator uploading to an IMAP Server
Copyright (c) 2005 Lucas Nussbaum <lucas@lucas-nussbaum.net>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
=end

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'rexml/document'
require 'yaml'

DEFAULTIMAPFOLDER = 'imap://login:password@imapserver/folder.folder2'

opml = ARGV[0]
doc = nil
doc = REXML::Document::new(IO.read(opml))
feeds = []
doc.root.each_element('//outline') do |e|
  if u = e.attribute('xmlUrl') || e.attribute('htmlUrl')
    # dirty liferea hack
    next if u.value == 'vfolder'
    # get title
    t = e.attribute('text') || e.attribute('Title') || nil
    if t.nil?
      title = '*** FEED TITLE (must be unique) ***'
    else
      title = t.value
    end
    url = u.value
    feeds.push({'name' => title, 'url' => url, 'target' => DEFAULTIMAPFOLDER})
  end
end
YAML::dump({'feeds' => feeds}, $stdout)
2-01 17:21:02 +0100'>2022-02-01Please `go vet`René 'Necoro' Neumann1-1/+1 2022-02-01File ChooserRené 'Necoro' Neumann3-3/+64 2022-02-01[Windows] DPI Awareness: SystemRené 'Necoro' Neumann1-2/+2 2022-02-01Revert "[Windows] Remove DPI awareness"René 'Necoro' Neumann1-0/+2 This reverts commit 868e8f7b1649706f0c17a532bad69f6026937954. 2022-02-01[Windows] Remove DPI awarenessRené 'Necoro' Neumann1-2/+0 2022-02-01Fix warningRené 'Necoro' Neumann1-7/+7 2022-02-01Fix icon loadingRené 'Necoro' Neumann1-1/+1 2022-02-01Move resources to own folderRené 'Necoro' Neumann5-4/+4 2022-02-01Icon and better windows dataRené 'Necoro' Neumann6-1/+51 2022-02-01Combo BoxesRené 'Necoro' Neumann2-22/+27 2022-02-01Add windows manifestRené 'Necoro' Neumann3-0/+34 2022-02-01Use our version of giuRené 'Necoro' Neumann2-2/+4 2022-02-01go mod tidyRené 'Necoro' Neumann2-4/+3 2022-02-01Use up2date giuRené 'Necoro' Neumann1-1/+1 2022-02-01GUI: GridLayoutRené 'Necoro' Neumann1-2/+62 2022-01-29[release]: Move checkout to the frontRené 'Necoro' Neumann1-3/+3 2022-01-29[release]: Make Windows build link staticRené 'Necoro' Neumann1-1/+1 2022-01-29[release]: Fix multiple issuesRené 'Necoro' Neumann1-10/+8 2022-01-29Start with a basic GUIRené 'Necoro' Neumann4-2/+73 2022-01-29[release]: Fix github variable syntaxRené 'Necoro' Neumann1-2/+2 2022-01-29Build on windows and linuxRené 'Necoro' Neumann1-6/+9 2022-01-29Build on windows and linuxRené 'Necoro' Neumann1-45/+58 2022-01-25const blockRené 'Necoro' Neumann1-3/+5 2022-01-25Slight restructuringRené 'Necoro' Neumann2-84/+93 2022-01-24Add test stuff to .gitignoreRené 'Necoro' Neumann1-1/+7 2022-01-24Factor out `writeOutput`René 'Necoro' Neumann1-15/+15 2022-01-24Create clubs and participants files also via templateRené 'Necoro' Neumann4-113/+63