Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 1566 Bytes
1 | #!/usr/bin/env ruby |
2 | |
3 | # RSS 0.2/2.0/Atom converter to typo by Lennon Day-Reynolds <rcoder@gmail.com> |
4 | # Shamelessly copied from RSS-only converter by Chris Lee |
5 | |
6 | require File.dirname(__FILE__) + '/../../config/environment' |
7 | require 'optparse' |
8 | begin |
9 | require 'feed_tools' |
10 | rescue LoadError |
11 | STDERR.puts <<-EOF |
12 | This converter requires feedtools to be installed. |
13 | Please run `gem install feedtools` and try again. |
14 | EOF |
15 | exit 1 |
16 | end |
17 | |
18 | class FeedMigrate |
19 | attr_accessor :options |
20 | |
21 | def initialize |
22 | self.options = {} |
23 | self.parse_options |
24 | self.convert_entries |
25 | end |
26 | |
27 | def convert_entries |
28 | feed = FeedTools::Feed.open(self.options[:url]) |
29 | puts "Converting #{feed.items.length} entries..." |
30 | feed.items.each do |item| |
31 | puts "Converting '#{item.title}'" |
32 | a = Article.new |
33 | a.author = self.options[:author] |
34 | a.title = item.title |
35 | a.body = item.description |
36 | a.created_at = item.published |
37 | a.save |
38 | end |
39 | end |
40 | |
41 | def parse_options |
42 | OptionParser.new do |opt| |
43 | opt.banner = 'Usage: feed.rb [options]' |
44 | |
45 | opt.on('-a', '--author AUTHOR', 'Username of author in typo') do |a| |
46 | self.options[:author] = a |
47 | end |
48 | |
49 | opt.on('-u', '--url URL', 'URL of RSS feed to import.') do |u| |
50 | self.options[:url] = u |
51 | end |
52 | |
53 | opt.on_tail('-h', '--help', 'Show this message.') do |
54 | puts opt |
55 | exit |
56 | end |
57 | |
58 | opt.parse!(ARGV) |
59 | end |
60 | |
61 | unless self.options.include?(:author) and self.options.include?(:url) |
62 | puts 'See feed.rb --help for help.' |
63 | exit |
64 | end |
65 | end |
66 | end |
67 | |
68 | FeedMigrate.new |