You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2019/05/08 00:40:31 UTC
[whimsy] branch master updated: Fix years; only use board for board
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 ae28826 Fix years; only use board for board
new 8a928f2 Merge branch 'master' of https://github.com/apache/whimsy
ae28826 is described below
commit ae288262022a47ac8cd7259db8a74eaa18cb56b6
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Tue May 7 20:40:02 2019 -0400
Fix years; only use board for board
---
tools/ponypoop.rb | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/ponypoop.rb b/tools/ponypoop.rb
index 55958d7..95612af 100755
--- a/tools/ponypoop.rb
+++ b/tools/ponypoop.rb
@@ -173,6 +173,10 @@ def optparse
options[:mbox] = true
end
+ opts.on('-yYEAR', '--year YEAR', 'Only pull down single year, instead of 2010 thru now') do |y|
+ options[:year] = y
+ end
+
begin
opts.parse!
rescue OptionParser::ParseError => e
@@ -189,9 +193,12 @@ end
# Main method for command line use
if __FILE__ == $PROGRAM_NAME
months = %w( 1 2 3 4 5 6 7 8 9 10 11 12 )
- years = %w( 2010 2011 2012 2013 2014 2015 2016 2017 )
+ years = %w( 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 )
options = optparse
options[:list] ||= 'board'
+ if options[:year]
+ years = [ options[:year] ]
+ end
if options[:pull]
puts "BEGIN: Pulling down stats JSONs in #{options[:dir]} of list: #{options[:list]}@#{options[:subdomain]}"
PonyAPI::get_pony_stats_many options[:dir], options[:list], options[:subdomain], years, months, options[:cookie]
@@ -200,7 +207,7 @@ if __FILE__ == $PROGRAM_NAME
PonyAPI::get_pony_mbox_many options[:dir], options[:list], options[:subdomain], years, months, options[:cookie]
else
puts "BEGIN: Analyzing local JSONs in #{options[:dir]} of list: #{options[:list]}"
- run_analyze_stats options[:dir], options[:list], BOARD_REGEX
+ run_analyze_stats options[:dir], options[:list], 'board'.eql?(options[:list]) ? BOARD_REGEX : {}
end
puts "END: Thanks for running ponypoop - see results in #{options[:dir]}"
end