-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtweet
More file actions
executable file
·26 lines (23 loc) · 734 Bytes
/
tweet
File metadata and controls
executable file
·26 lines (23 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env ruby
require "twitter"
require "googl"
require (ENV["XDG_CONFIG_HOME"]||(ENV["HOME"]+"/.config"))+"/shemmesware/config"
Twitter.configure do |config|
config.consumer_key = Conf.tconsumer_key
config.consumer_secret = Conf.tconsumer_secret
config.oauth_token = Conf.toauth_token
config.oauth_token_secret = Conf.toauth_token_secret
end
# Initialize your Twitter client
client = Twitter::Client.new
unless ARGV[0].nil? or ARGV.join(" ").length > 140
client.update ARGV.join(" ")
puts "you just tweeted: " + ARGV.join(" ")
puts "hashtags:"
ARGV.each do |word|
puts word if word[0] == "#"
end
else
puts "message was either empty or greater than 140 characters"
puts "USAGE: tweet <message>"
end