Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created March 26, 2011 17:33
Show Gist options
  • Save benlangfeld/888464 to your computer and use it in GitHub Desktop.
Save benlangfeld/888464 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# encoding: UTF-8
#require 'rubygems'
require 'csv'
#require 'yaml'
#require 'ya2yaml' # this is to use proper UTF8
require 'twitter'
#require 'digest/md5'
Twitter.configure do |config|
config.consumer_key = "7XXXXXXXXXXXXw"
config.consumer_secret = "qXXXXXXXXXXXXjQxJCKm0"
config.oauth_token = "21XXXXXXXXXXXXXiCrw1uSJ"
config.oauth_token_secret = "5XXXXXXXXXXXXXXrtuLU"
end
client = Twitter::Client.new
time = Time.now
day_of_month = time.getlocal("-08:00").day
CSV.foreach('/Users/ben/Downloads/data2.csv', :encoding => "UTF-8") do |date, info, info2|
if date.split('/').first.to_i == day_of_month
text = info2.nil? || info2.empty? ? "#{info} " : "#{info}, #{info2}"
# client.update "This is a test."
#client.update "Σήμερα " + time.strftime("%d/%m/%Y")+ "\nΔιανυκτερεύει: #{text}"
puts "Σήμερα #{time.strftime("%d/%m/%Y")}, Διανυκτερεύει: #{text}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment