Skip to content

Instantly share code, notes, and snippets.

@madx
Created April 21, 2009 13:31
Show Gist options
  • Save madx/99141 to your computer and use it in GitHub Desktop.
Save madx/99141 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
%w(rubygems rzen time).each{|l| require l}
gem("twitter4r", ">=0.2.4")
require "twitter"
include Twitter
include RZen
message = ARGV[0]
if message.nil? || message.empty?
message = Entry.get(:title => "Twit", :text => "Twitter: ", :width => 500)
end
if message.length > 140
`notify-send -t 2000 "Twitter" "Message trop long"`
elsif message.empty?
`notify-send -t 2000 "Twitter" "Pas de message"`
else
Client.new(:login => 'madx', :password => 'i6ph2f3teappaa5c').
status(:post, message)
`notify-send -t 2000 "Twitter" "Message posté"`
end
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment