rudimentary .newsrc support
This commit is contained in:
parent
2140862d3e
commit
7ef2a9c568
1 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@
|
|||
require 'date'
|
||||
require 'getoptlong'
|
||||
require 'news/article'
|
||||
require 'news/newsrc'
|
||||
|
||||
|
||||
###########################################################################
|
||||
|
|
@ -145,12 +146,15 @@ if Debuglevel > 1
|
|||
end
|
||||
end
|
||||
|
||||
newsrc = News::Newsrc.new(".newsrc")
|
||||
|
||||
articles = Article.new(options["NNTPSERVER"])
|
||||
#articles.get_articles("alt.binaries.e-book.flood")
|
||||
articles.set_skip_ids(newsrc.marked_articles("alt.binaries.e-book.technical"))
|
||||
articles.get_articles("alt.binaries.e-book.technical")
|
||||
|
||||
|
||||
for i in articles.get_group_subjects
|
||||
print "#{i}\n" if Debuglevel > 1
|
||||
if i =~ /#{options["-I"]}/i
|
||||
print "Match: #{i}\n" if Debuglevel > 0
|
||||
if articles.group_complete(i)
|
||||
|
|
@ -182,6 +186,10 @@ for i in articles.get_group_subjects
|
|||
print "shortname\n" if Debuglevel > 1
|
||||
save_file(options["DATADIR"], filename, body)
|
||||
end
|
||||
marked = articles.get_group_ids(i)
|
||||
newsrc.mark_list("alt.binaries.e-book.technical", marked)
|
||||
newsrc.save
|
||||
marked.collect!{|x| print "marked: #{x}\n"}
|
||||
end
|
||||
# rm file & fileout
|
||||
File.delete(fullname)
|
||||
|
|
@ -192,4 +200,5 @@ for i in articles.get_group_subjects
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
articles.quit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue