Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I could fetch linkedin company details in xml or json format. request:https://api.linkedin.com/v1/companies/xx/updates?oauth2_access_token=yyy&format=xml&event-type=status-update&count=5
XML response:
JavaScript
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
- <updates total="14" count="5" start="0">
- <update>
  <timestamp>1437636282601</timestamp> 
  <update-key>UPDATE-c5818-6029883610604060672</update-key> 
  <update-type>CMPY</update-type> 
- <update-content>
- <company>
  <id></id> 
  <name>A</name> 
  </company>
- <company-status-update>
- <share>
  <id>s6029883610616647680</id> 
  <timestamp>1437636282601</timestamp> 
- <visibility>
  <code>anyone</code> 
  </visibility>
  <comment>gggg</comment> 
- <content>
  <submitted-url>http://linkd.in/1HKYs2g</submitted-url> 
  <shortened-url>http://linkd.in/1HKYs2g</shortened-url> 
  <title>AtradiusCollections SeniorManager.PNG</title> 
  <description /> 
  <submitted-image-url>http://image-store.slidesharecdn.com/e1bbbc3d-3abf-42f4-8187-4e7c10e98401-large.png</submitted-image-url> 
  <thumbnail-url>https://media.licdn.com/media-proxy/ext?w=80&h=100&f=&hash=gEBkvCFYaW%2FL4IZJhAVM8N7R6Us%3D&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta9Er0Vinkhwfjw8177yE41y87UNCVordEGXyD3u0qYrdfyLoK5WNKrH1uV5HKnoclAZke_KgQTjmD5fpLNnufYl4g5PlJY24ZxUBbFImi24</thumbnail-url> 
  <eyebrow-url>http://linkd.in/1HKYs2g</eyebrow-url> 
  </content>
- <source>
- <service-provider>
  <name>LINKEDIN</name> 
  </service-provider>
  <service-provider-share-id>s6029883610616647680</service-provider-share-id> 
  </source>
  </share>
  </company-status-update>
  </update-content>
  <is-commentable>true</is-commentable> 
  <update-comments total="0" /> 
  <is-likable>true</is-likable> 
  <is-liked>false</is-liked> 
  <num-likes>5</num-likes> 
- <likes total="3">
      </likes>
  </update>


Now this response,I need to parse and display on homepage.Any help ?
Posted
Comments
Richard Deeming 23-Jul-15 9:03am    
If you're doing this from javascript, why not use the JSON format instead? You'll get a sensible javascript object returned, with no parsing required.
bg13 24-Jul-15 1:08am    
Yes.I could generate response in json format as well.But,I am new to java so not sure of how to use json response.Any pointers or help on json is much appreciated!I need to display this on jsp page.
Richard Deeming 24-Jul-15 7:40am    
Despite the names, java and javascript are two completely different languages. You're using javascript, not java.

There's a JSON tutorial on the W3Schools site: http://www.w3schools.com/json/[^]

Basically, if you get the response using the JSON format, you'll get a fully-populated javascript object. You won't need to parse anything, and you can just concentrate on displaying the data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900