Skip to content

Instantly share code, notes, and snippets.

@bigthyme
Created November 24, 2012 23:47
Show Gist options
  • Save bigthyme/4141836 to your computer and use it in GitHub Desktop.
Save bigthyme/4141836 to your computer and use it in GitHub Desktop.
pt.2
#We are using a twitter API method here: http://tutorials.jumpstartlab.com/topics/environment/environment.html
def tweet(message)
#[5]if logic that will check if the user's message is equal to 140. If the message is shorter,
#then it'll tell the user how many characters were used out of 140. If not, it will throw an
#error message.
if message.length >= 140
puts "People are yawning, please shorten your message"
else
puts "You've used " + message.length.to_s + " characters out of 140"
end
@client.update(message)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment