Misc fixes
This commit is contained in:
@@ -68,10 +68,10 @@ class WpTarget < WebSite
|
|||||||
users << row
|
users << row
|
||||||
end
|
end
|
||||||
|
|
||||||
if users
|
# Sort and uniq
|
||||||
# Sort and uniq
|
users = users.sort.uniq
|
||||||
users = users.sort.uniq
|
|
||||||
|
|
||||||
|
if users and users.size > 1
|
||||||
# Feedback
|
# Feedback
|
||||||
grammar = grammar_s(users.size)
|
grammar = grammar_s(users.size)
|
||||||
puts warning("#{users.size} user#{grammar} exposed via API: #{json_users_url}")
|
puts warning("#{users.size} user#{grammar} exposed via API: #{json_users_url}")
|
||||||
|
|||||||
@@ -36,16 +36,19 @@ class WpTarget < WebSite
|
|||||||
# Read in RSS/XML
|
# Read in RSS/XML
|
||||||
xml = Nokogiri::XML(data)
|
xml = Nokogiri::XML(data)
|
||||||
|
|
||||||
# Look for <dc:creator> item
|
begin
|
||||||
xml.xpath('//item/dc:creator').each do |node|
|
# Look for <dc:creator> item
|
||||||
#Format: <dc:creator><![CDATA[.*]]></dc:creator>
|
xml.xpath('//item/dc:creator').each do |node|
|
||||||
users << [%r{.*}i.match(node).to_s]
|
#Format: <dc:creator><![CDATA[.*]]></dc:creator>
|
||||||
|
users << [%r{.*}i.match(node).to_s]
|
||||||
|
end
|
||||||
|
rescue
|
||||||
end
|
end
|
||||||
|
|
||||||
if users
|
# Sort and uniq
|
||||||
# Sort and uniq
|
users = users.sort_by { |user| user.to_s.downcase }.uniq
|
||||||
users = users.sort_by { |user| user.to_s.downcase }.uniq
|
|
||||||
|
|
||||||
|
if users and users.size > 1
|
||||||
# Feedback
|
# Feedback
|
||||||
grammar = grammar_s(users.size)
|
grammar = grammar_s(users.size)
|
||||||
puts warning("Detected #{users.size} user#{grammar} from RSS feed:")
|
puts warning("Detected #{users.size} user#{grammar} from RSS feed:")
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ def main
|
|||||||
if code == 200
|
if code == 200
|
||||||
puts info("humans.txt available under: #{wp_target.humans_url} [HTTP #{code}]")
|
puts info("humans.txt available under: #{wp_target.humans_url} [HTTP #{code}]")
|
||||||
|
|
||||||
wp_target.parse_txt(humans_url).each do |dir|
|
parse_txt(wp_target.humans_url).each do |dir|
|
||||||
puts info("Entry from humans.txt: #{dir}")
|
puts info("Entry from humans.txt: #{dir}")
|
||||||
end
|
end
|
||||||
spacer()
|
spacer()
|
||||||
@@ -272,7 +272,7 @@ def main
|
|||||||
if code == 200
|
if code == 200
|
||||||
puts info("security.txt available under: #{wp_target.security_url} [HTTP #{code}]")
|
puts info("security.txt available under: #{wp_target.security_url} [HTTP #{code}]")
|
||||||
|
|
||||||
wp_target.parse_txt(security_url).each do |dir|
|
parse_txt(wp_target.security_url).each do |dir|
|
||||||
puts info("Entry from security.txt: #{dir}")
|
puts info("Entry from security.txt: #{dir}")
|
||||||
end
|
end
|
||||||
spacer()
|
spacer()
|
||||||
|
|||||||
Reference in New Issue
Block a user