lib/linked_in/client.rb in linkedin-idkmybffjill-0.2.1 vs lib/linked_in/client.rb in linkedin-idkmybffjill-0.2.2

- old
+ new

@@ -125,18 +125,25 @@ options = {:keywords => options} if options.is_a?(String) options = format_options_for_query(options) People.from_xml(get(to_uri(path, options))) end + + def create_network_update(text) + path = "/people/~/person-activities" + post(path, network_update_to_xml(CGI.escapeHTML(text)), {"Content-Type" => "text/xml"}) + end def current_status path = "/people/~/current-status" Crack::XML.parse(get(path))['current_status'] end + #NOTE: this is a deprecated API. Please use the Share API, + # which is not currently implemented def update_status(text) - path = "/people/~/current-status" + path = "/people/~/person-activities" put(path, status_to_xml(text)) end def update_comment(network_key, comment) path = "/people/~/network/updates/key=#{network_key}/update-comments" @@ -287,10 +294,16 @@ path += "url=#{CGI.escape(options[:url])}" else path += "~" end end - + + def network_update_to_xml(update) + %Q{<activity locale="en_US"> + <content-type>linkedin-html</content-type> + <body>#{update}</body></activity>} + end + def status_to_xml(status) %Q{<?xml version="1.0" encoding="UTF-8"?> <current-status>#{status}</current-status>} end