bin/pinpress in pinpress-1.1.2 vs bin/pinpress in pinpress-1.2.0

- old
+ new

@@ -144,15 +144,19 @@ elsif configuration.pinpress[:default_num_results] opts.merge!(results: configuration.pinpress[:default_num_results]) end if options[:t] - opts.merge!(tag: options[:t]) + tags = options[:t].split(',') elsif configuration.pinpress[:default_tags] - opts.merge!(tag: configuration.pinpress[:default_tags]) + tags = configuration.pinpress[:default_tags] end + ignored_tags = configuration.pinpress[:ignored_tags] + tags -= ignored_tags if ignored_tags + opts.merge!(tag: tags) if tags + begin pins = client.posts(opts) if !pins.empty? print template.opener if template.opener pins.each do |p| @@ -201,13 +205,17 @@ opts = {} opts.merge!(todt: Chronic.parse(options[:e])) if options[:e] opts.merge!(fromdt: Chronic.parse(options[:s])) if options[:s] if options[:t] - opts.merge!(tag: options[:t]) + tags = options[:t].split(',') elsif configuration.pinpress[:default_tags] - opts.merge!(tag: configuration.pinpress[:default_tags]) + tags = configuration.pinpress[:default_tags] end + + ignored_tags = configuration.pinpress[:ignored_tags] + tags -= ignored_tags if ignored_tags + opts.merge!(tag: tags) if tags begin pins = client.posts(opts) pins.each { |p| tags += p[:tag] } tags = tags.uniq.map { |t| { tag: t, count: tags.count(t) } }