whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch master updated: Sketch of crawler to build related tools links
Date Sat, 29 Apr 2017 01:23:45 GMT
This is an automated email from the ASF dual-hosted git repository.

curcuru 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  a156d46   Sketch of crawler to build related tools links
a156d46 is described below

commit a156d46b0899927639d8ee9e2e9db62181a5e752
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Fri Apr 28 21:23:40 2017 -0400

    Sketch of crawler to build related tools links
---
 tools/wwwdocs.rb       | 21 +++++++++++++++++++++
 www/test/test.cgi      |  2 +-
 www/test/trademark.cgi |  1 +
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/tools/wwwdocs.rb b/tools/wwwdocs.rb
new file mode 100755
index 0000000..88c3e0e
--- /dev/null
+++ b/tools/wwwdocs.rb
@@ -0,0 +1,21 @@
+#!/usr/bin/env ruby
+# Wvisible:tools Crawl scripts and emit homepage related links
+$LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
+require 'json'
+
+ # TODO: crawl all tools that might be URLs under www
+ # If there's a Wvisible line, store it's cat,egor,ies And long description
+startdir = '../www/test'
+
+homelinks = {}
+
+Dir["#{startdir}/*.cgi"].each do |f|
+  File.open(f).each_line.map(&:chomp).each do |line|
+    if line =~ /^\#\sWvisible\:\s*/i then
+      line =~ /# Wvisible:(.*?) (.*)/; line = [$1.split(','), $2]
+      puts "2 #{line}"
+      homelinks[f] = line # TODO make paths relative for easy _a output
+    end
+  end
+end
+puts JSON.pretty_generate homelinks
diff --git a/www/test/test.cgi b/www/test/test.cgi
index 471f213..aeb71fa 100755
--- a/www/test/test.cgi
+++ b/www/test/test.cgi
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-# Transform docket.csv into JSON structure for other uses
+# Wvisible:deprecated,tools Transform docket.csv into JSON structure for other uses
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'csv'
 require 'json'
diff --git a/www/test/trademark.cgi b/www/test/trademark.cgi
index a2cd1ce..95c4652 100755
--- a/www/test/trademark.cgi
+++ b/www/test/trademark.cgi
@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+# Wvisible:deprecated,brand Listing of trademarks-old
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'csv'
 require 'json'

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message