Improve documentation, add sample config and readme.

This commit is contained in:
Anna Rose Wiggins 2016-04-18 16:32:26 -04:00
parent 321d770263
commit 469212c74c
3 changed files with 29 additions and 0 deletions

View file

@ -26,12 +26,14 @@ serial_posts.sort! { |x,y| y.time <=> x.time }
domains = []
serial_posts.each do |post|
metric[:posts] += 1
# Extract the domain from the full URL
domain = post.href.sub(/^https?:\/\/(.*?)\/.*$/, "\\1")
if !domains.include? domain
# Record that we've seen the domain now.
domains.push domain
else
# If this is a duplicate, soft-delete it.
post.tag.delete config['active_tag_name']
post.tag.push config['deleted_tag_name']
post.shared = false