views:

38

answers:

2

Does anyone have an example that parses out the information from a LinkedIn profile using VB Script? I have a database which contains client information and I have been including the client Key for LinkedIn in hopes to have it automatically update some or possibly all of the information for that client.

Sincerely, Christopher J. Schärer

A: 

Not sure what you want out of there, but you'll want to use the Microsoft XMLHTTP request object. My syntax may be a little rusty, and you should add error handling, but that looks roughly like this (complete reference easy to find on Google):

dim url, contents
dim xmlhttp_o
set xmlhttp_o = createobject( "microsoft.xmlhttp" )

'* generate complete url with the keys in your db *'
url = "http://linkedin.com/<whatever...>"

xmlhttp_o.open "get", url, false
xmlhttp_o.send

contents = xmlhttp_o.responsetext

At that point, contents contains the HTML of the page you want on LinkedIn. A little string manipulation can get out whatever you want.

dmb
A: 

The following line of code gives me a run time error.

obj_XMLHTTP.Send

'Code Dim str_URL Dim var_HTML Dim obj_XMLHTTP

Set obj_XMLHTTP = CreateObject("microsoft.xmlhttp")
'* generate complete str_URL with the keys in your db *'
str_URL = "http://www.linkedin.com/profile/view?id=12160604"
Call obj_XMLHTTP.Open("get", str_URL, False)
Call obj_XMLHTTP.Send
var_HTML = obj_XMLHTTP.ResponseText
Set obj_XMLHTTP = Nothing
MsgBox var_HTML
Chris