typograf.rb

# encoding: utf-8 require 'unirest' class String def typograf api_uri = 'http://www.typograf.ru/webservice/' begin response = Unirest.post api_uri, parameters: {text: self} response.body rescue self end end end # Use Typograf from CLI if __FILE__ == $0 if ARGV[0].nil? puts 'usage: typograf text' puts 'example: typograf "foo - bar"' else puts ARGV[0].typograf end end
Typograf

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.