Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
buffer-schedule: Schedule all yer updates
require 'optparse'
require 'csv'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: buffer_schedule.rb [file.csv] [options]"
opts.on("-tTYPE", "--type=TYPE", "Type: twitter, facebook, linkedin") do |type|
options[:type] = type
end
opts.on("-dDAYS", "--delay-days=DAYS", "Start scheduling DAYS from now") do |days|
options[:delay] = days
end
opts.on("-nNUM", "--num=NUM", "Schedule NUM posts per day") do |num|
options[:num] = num
end
end.parse!
file_name = ARGV[0]
CSV.for_each(file_name) do |row|
puts row[0]
puts row[1].present?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.