Created
February 29, 2016 19:00
-
-
Save ryana/5870797bfc1aaa860fca to your computer and use it in GitHub Desktop.
buffer-schedule: Schedule all yer updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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