On Nov 4, 8:18 pm, dowhilesomething <[EMAIL PROTECTED]>
wrote:
> Is this possible?  Everything I try to do comes out as text.

As long as it looks like a url it seems to work,
namely with the http://

I wrote a bit of code to tinyurl-ise any links
http://github.com/matthewrudy/rudebay/tree/master/lib/rudebay/twitterer.rb

""" ruby
def self.make_tinyurl(link)
  url = URI.parse('http://tinyurl.com/api-create.php')
  req = Net::HTTP::Post.new(url.path)
  req.set_form_data('url' => link)
  res = Net::HTTP.new(url.host, url.port).start {|http|
http.request(req) }

  return res.body
end
"""

Reply via email to