From ef344270e5f31ec8855c9f2d23b87e09037add5f Mon Sep 17 00:00:00 2001 From: Pramod Date: Sat, 21 Feb 2015 16:51:15 +0530 Subject: [PATCH] Company Rest API documentations links updated - Updated company API documention to have correct api links as old links are deprecated - CGI.escape for boolean removed - Updated README.md to have updated company API docs link --- README.md | 2 +- lib/linked_in/companies.rb | 32 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index b99f270..13487b5 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,7 @@ api.join_group(12345) Detailed overviews of Company information -See https://developer.linkedin.com/documents/companies +See https://developer.linkedin.com/docs/company-pages ```ruby # Company info diff --git a/lib/linked_in/companies.rb b/lib/linked_in/companies.rb index 9c4e754..cdf5650 100644 --- a/lib/linked_in/companies.rb +++ b/lib/linked_in/companies.rb @@ -1,8 +1,8 @@ module LinkedIn # Companies API # - # @see http://developer.linkedin.com/documents/companies Companies API - # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields Company Fields + # @see https://developer.linkedin.com/docs/company-pages Companies API + # @see https://developer.linkedin.com/docs/fields/company-profile Company Fields # # The following API actions do not have corresponding methods in # this module @@ -16,8 +16,9 @@ class Companies < APIResource # Retrieve a Company Profile # - # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields - # + # @see https://developer.linkedin.com/docs/company-pages#company_profile + # @see https://developer.linkedin.com/docs/fields/company-profile + # # @macro company_path_options # @option options [String] :scope # @option options [String] :type @@ -31,7 +32,7 @@ def company(options = {}) # Retrieve a feed of event items for a Company # - # @see http://developer.linkedin.com/reading-company-shares + # @see https://developer.linkedin.com/docs/company-pages#company_updates # # @macro company_path_options # @option options [String] :event-type @@ -47,7 +48,7 @@ def company_updates(options={}) # # Permissions: rw_company_admin # - # @see http://developer.linkedin.com/documents/company-statistics + # @see https://developer.linkedin.com/docs/company-pages#statistics # # @macro company_path_options # @return [LinkedIn::Mash] @@ -60,7 +61,7 @@ def company_statistics(options={}) # # Permissions: rw_company_admin # - # @see http://developer.linkedin.com/historical-company-statistics#historicalfollowerstatistics + # @see https://developer.linkedin.com/docs/company-pages#historical_followers # # @macro company_path_options # @option options [String] :start-timestamp @@ -76,7 +77,7 @@ def company_historical_follow_statistics(options = {}) # # Permissions: rw_company_admin # - # @see https://developer.linkedin.com/historical-company-statistics#historicalupdatestatistics + # @see https://developer.linkedin.com/docs/company-pages#historical_updates # # @macro company_path_options # @option options [String] :start-timestamp @@ -92,7 +93,7 @@ def company_historical_status_update_statistics(options = {}) # Retrieve comments on a particular company update: # - # @see http://developer.linkedin.com/reading-company-shares + # @see https://developer.linkedin.com/docs/company-pages#get_update_comments # # @param [String] update_key a update/update-key representing a # particular company update @@ -105,7 +106,7 @@ def company_updates_comments(update_key, options={}) # Retrieve likes on a particular company update: # - # @see http://developer.linkedin.com/reading-company-shares + # @see https://developer.linkedin.com/docs/company-pages#get_update_likes # # @param [String] update_key a update/update-key representing a # particular company update @@ -121,8 +122,7 @@ def company_updates_likes(update_key, options={}) # # Permissions: rw_company_admin # - # @see http://developer.linkedin.com/creating-company-shares - # @see http://developer.linkedin.com/documents/targeting-company-shares Targeting Company Shares + # @see https://developer.linkedin.com/docs/company-pages#company_share # # @param [String] company_id Company ID # @macro share_input_fields @@ -135,7 +135,7 @@ def add_company_share(company_id, share) # (Create) authenticated user starts following a company # - # @see http://developer.linkedin.com/documents/company-follow-and-suggestions + # @see https://developer.linkedin.com/docs/company-pages # # @param [String] company_id Company ID # @return [void] @@ -146,7 +146,7 @@ def follow_company(company_id) # (Destroy) authenticated user stops following a company # - # @see http://developer.linkedin.com/documents/company-follow-and-suggestions + # @see https://developer.linkedin.com/docs/company-pages # # @param [String] company_id Company ID # @return [void] @@ -155,10 +155,8 @@ def unfollow_company(company_id) delete(path) end - private ############################################################## - def company_path(options) path = "/companies" @@ -171,7 +169,7 @@ def company_path(options) elsif name = options.delete(:name) path += "/universal-name=#{CGI.escape(name)}" elsif is_admin = options.delete(:is_admin) - path += "?is-company-admin=#{CGI.escape(is_admin)}" + path += "?is-company-admin=#{is_admin}" else path += "/~" end