轮回天龙:kk1987/list2rss - GitHub

来源:百度文库 编辑:九乡新闻网 时间:2024/04/29 19:19:29
README.md

List2Rss

Generates RSS from contents of various web sites.

Usage

Write an invoking script in which you specify how and for what contentthe RSS feed will be generated. An example is given below:

#!/usr/bin/env ruby1.9.1Dir.chdir '/path/to/list2rss'load 'list2rss.rb'rss = List2Rss.new(# choose which plugin to use# (this is mandatory, while all other parameters are optional):site => :exploit_db,# class variable overrides (see list2rss.rb):channel => {:title => 'Linux exploits',:link => 'http://your.domain/static/rss1.xml'}# other parameters are passed down as-is# see individual plugin code for usage details:category => ['platform=linux', 'platform=lin/x86']).to_xmlFile.open('/var/www/static/rss1.xml', 'w') { |f| f << rss }rss = List2Rss.new(:site => :newsmth,# will get top 10 threads instead if no board is given:board => 'Joke',# only include original post:select => :single,# save attachments to local file system if this is set:static_dir => '/var/www/static',# replace attachment links in output if this is also set:static_root => 'http://your.domain/static',# maximum number of download threads (default: unlimited):threads => 6,:channel => {:title => 'NewSMTH - Joke',# NOTE if you are using a plugin with different sets of# parameters, data_dir must be set to unique values:data_dir => 'smth_joke',:link => 'http://your.domain/static/rss2.xml'}).to_xmlFile.open('/var/www/static/rss2.xml', 'w') { |f| f << rss }rss = List2Rss.new(:site => :newsmth,# act as logged-in user:id => 'some_smth_id',:password => 'some_password',:static_dir => '/var/www/static',:static_root => 'http://your.domain/static',:threads => 6,:channel => {:title => 'NewSMTH - Top10',# NOTE must be unique:data_dir => 'smth_top10',:link => 'http://your.domain/static/rss3.xml'}).to_xmlFile.open('/var/www/static/rss3.xml', 'w') { |f| f << rss }