Skip to content

Instantly share code, notes, and snippets.

@MattHall
Created December 5, 2010 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattHall/729218 to your computer and use it in GitHub Desktop.
Save MattHall/729218 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'uri'
require 'rubygems'
@auth = {:api_token => 'my token'}
Net::HTTP.start('posterous.com') {|http|
req = Net::HTTP::Get.new("/api/v2/users/me/sites/primary/posts?api_token=#{@auth[:api_token]}")
req.basic_auth 'my email address', 'my password'
response = http.request(req)
puts response.body
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment