Craig Jolicoeur wrote:>
> I''m trying to put together some functionality in my rails app to
import
> a users bookmarks from del.icio.us
>
> from the del.icio.us API documentation site they state:
>
> "All del.icio.us APIs are done over https and require HTTP-Auth."
>
> how are people handling the processing of HTTP authentication in
> situations like this when you are just making calls to a third-party
> API. obviously I have the user input their del.icio.us username/password
> but what is the process/request to del.icio.us to setup the
> authentication for the subsequent call to retrieve all their bookmarks?
>
Hi
If it is similar to FeedBurner''s protocol, this might get you on the
right track:
#########
require ''net/https''
require ''rexml/document''
username, password = #initialize_details...
f = Net::HTTP.new(''api.feedburner.com'', 443'')
f.use_ssl = true
status, response = f.post("management/1.0/AddFeed",
''authorization'' =>
{"#{username}:#{password}"})
xml_reponse = REXML::Document.new(response)
#########
This is in essence what I did in a feedburner plugin I wrote a while back.
I don''t know how much alike the two are, but if it helps, here are the
links...
docs: http://combustible.rubyforge.org/docs/
the actual code file:
svn://rubyforge.org/var/svn/combustible/trunk/lib/combustible.rb
Regards,
Gustav Paul
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---