Skip to content

Instantly share code, notes, and snippets.

@lytsing
Created September 21, 2012 07:52
Show Gist options
  • Save lytsing/3760248 to your computer and use it in GitHub Desktop.
Save lytsing/3760248 to your computer and use it in GitHub Desktop.
Make long url into short url from http://t.cn
#!/usr/bin/ruby
#
# encoding: utf-8
#
# Make long url into short url from http://t.cn
#
require "uri"
require "net/http"
params = {
'url' => 'http://www.google.com',
'submit' => '转换'
}
x = Net::HTTP.post_form(URI.parse('http://www.henshiyong.com/tools/sina-shorten-url.php'), params)
puts x.body
@dmlcks56202
Copy link

dfdfsg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment