masterslowpoke

Untitled

Aug 6th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.44 KB | None | 0 0
  1. require 'unirest'
  2.  
  3. puts "Enter text to translate into l33t:"
  4. input = gets.chomp
  5.  
  6. input.gsub!("+", "%2B") # encode +s
  7. input.gsub!(" ", "+")
  8.  
  9. puts ""
  10.  
  11. response = Unirest.get "https://montanaflynn-l33t-sp34k.p.mashape.com/encode?text=#{input}",
  12.          headers:{:'X-Mashape-Key' => "tgz0o5hZ9jmshYIa3QgprhruS5j5p1Gjfchjsng6F7pkxJMB4W", :'Content-Type' => "application/x-www-form-urlencoded"}
  13.  
  14. puts "Translated text:"
  15. puts response.body
Advertisement
Add Comment
Please, Sign In to add comment