This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new c9860dee Show potential download pages
c9860dee is described below
commit c9860deef2378401d297148617756c928725b0dc
Author: Sebb <[email protected]>
AuthorDate: Thu May 9 22:59:27 2024 +0100
Show potential download pages
---
tools/site-scan.rb | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index 44582153..51d6647a 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -199,12 +199,11 @@ def parse(id, site, name, podling=false)
end
end
- # Brief scan of initial sub-pages to look for disclaimers
- # TODO also look for a download page?
- if podling
- hasdisclaimer = 0
- nodisclaimer = []
- subpages.each do |subpage, anchor|
+ # Brief scan of initial sub-pages to look for disclaimers and downloads
+ hasdisclaimer = 0
+ nodisclaimer = []
+ subpages.each do |subpage, anchor|
+ if podling
begin
uri, response, status = $cache.get(subpage)
if uri&.to_s == subpage or uri&.to_s == subpage + '/'
@@ -224,12 +223,15 @@ def parse(id, site, name, podling=false)
end
end
rescue URI::InvalidURIError
+ # ignore
end
end
- if nodisclaimer.size > 0
- data[:disclaimers] = [hasdisclaimer, nodisclaimer]
- end
end
+ if nodisclaimer.size > 0
+ data[:disclaimers] = [hasdisclaimer, nodisclaimer]
+ end
+ # Show potential download pages
+ data[:downloads] = subpages.select{|k,_v| k =~
%r{download|release|install|dlcdn\.apache\.org|dyn/closer}i}
# THIRD: see if an image has been uploaded
data[:image] = ASF::SiteImage.find(id)