Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Friday, February 09, 2007

Ruby HTTPS with HTTP Basic Auth

Fetching HTTPS data with Ruby using HTTP Basic Authorization

require 'net/http'
require 'net/https'

def get_feed(server,path,username,password)
http = Net::HTTP.new(server,443)
req = Net::HTTP::Get.new(path)
http.use_ssl = true
req.basic_auth username, password
response = http.request(req)
return response.body
end

Monday, November 13, 2006

Work Timer

I scratched an itch. Here's a simple task and time tracker written in Ruby.