Skip to content

Instantly share code, notes, and snippets.

@benbonnet
Created May 26, 2009 19:47
Show Gist options
  • Save benbonnet/118251 to your computer and use it in GitHub Desktop.
Save benbonnet/118251 to your computer and use it in GitHub Desktop.
url = URI.parse("http://www.blogger.com/feeds/#{article.blog_id}/posts/default")
http = Net::HTTP.new(url.host, url.port)
resp = http.start do |h|
req = Net::HTTP::Post.new(url.path, { "Authorization" => "GoogleLogin auth=#{auth}","Content-Type" => "application/atom+xml" })
req.body = entry.to_xml
h.request(req)
end
if resp.is_a? Net::HTTPCreated
true
else
puts resp
false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment