Skip to content

Instantly share code, notes, and snippets.

@ryana
Created February 29, 2016 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryana/5870797bfc1aaa860fca to your computer and use it in GitHub Desktop.
Save ryana/5870797bfc1aaa860fca to your computer and use it in GitHub Desktop.
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