<< | Index | >>
$ bin/oddb2xml --help bin/oddb2xml ver.1.0.7 Usage: oddb2xml [option] -c F, --compress=F Compress format F. Currently only 'tar.gz' is available. -a T, --append=T Additional target. T, only 'nonpharma' is available. -t S, --tag-suffix=S XML tag suffix S. Default is none. [A-z0-9_] If S is given, it is also used as prefix of filename. -h, --help Show this help message.
Update to use tag-suffix option also as filename (like md_product.xml
, md_article.xml
)
$ bin/oddb2xml --help bin/oddb2xml ver.1.0.7 Usage: oddb2xml [option] -c F, --compress=F Compress format F. Currently only 'tar.gz' is available. -a T, --append=T Additional target. T, only 'nonpharma' is available. -t S, --tag-suffix=S XML tag suffix S. Default is none. [A-z0-9_] If S is given, it is also used as prefix of filename. # => HERE -h, --help Show this help message.
Added zip option.
be bin/oddb2xml --help bin/oddb2xml ver.1.0.7 Usage: oddb2xml [option] -c F, --compress=F Compress format F. {tar.gz|zip} -a T, --append=T Additional target. T, only 'nonpharma' is available. -t S, --tag-suffix=S XML tag suffix S. Default is none. [A-z0-9_] If S is given, it is also used as prefix of filename. -h, --help Show this help message.
To add specs
oddb.org has rss feed as static file (passthru).
We cannot change dynamically links in rss file.
src/state/global.rb
def rss if(channel = @session.user_input(:channel)) key = channel.gsub('.', '_').to_sym if(@session.lookandfeel.enabled?(key)) Rss::PassThru.new(@session, channel) else Http404.new(@session, nil) end end end
Updated to use flavored rss feed.
def rss if(channel = @session.user_input(:channel)) key = channel.gsub('.', '_').to_sym if(@session.lookandfeel.enabled?(key)) if @session.flavor != Session::DEFAULT_FLAVOR channel = File.basename(channel, '.rss') + '-' + \ @session.flavor + '.rss' end Rss::PassThru.new(@session, channel) else Http404.new(@session, nil) end end end
And, created a method to generate flavored rss file for update job.
But production server has encoding error.
thinpower oddb.org # RUBY_OPT="" bin/admin ch.oddb> RssPlugin.new(self).generate_flavored_rss('recall.rss') -> invalid byte sequence in US-ASCII ch.oddb> RssPlugin.new(self).generate_flavored_rss('hpc.rss') -> invalid byte sequence in US-ASCII ch.oddb>
run as Job.
Then this copy method has worked with no error.