I’ve been building a reference site for use inside my company and am wondering if there’s any way to hack LinkedIn so that we can have a LinkedIn search box for individuals who work in our company? Yeah, we should have a company directory, but the boss is a huge LinkedIn fan…
Well, that’s a novel use of LinkedIn. You do realize that each person who uses the search will have different results, because it’s their LinkedIn account that will be used as the basis of how LinkedIn will actually present the results, right? And that the people whose records match will still have mostly non-functional data entries for your employee because if you aren’t linked to someone you can’t see most of their profile?
I don’t quite understand your logic here, but I can still show you how to reverse engineer the LinkedIn people search and create what you seek nonetheless.
The easiest way to accomplish this seems like it would be the basic people search that you see on the top right of most LinkedIn pages:
However, it’s not a freeform box a la Google, so you can’t do a search like “company:Microsoft name:smith,john”, so in fact it won’t work. Instead, we’re left having to explore the far more complicated “Advanced Search”, which is easily reached by clicking on “Advanced”. Now we’re in more sophisticated territory:
Before we crack open the hood and look inside, though, let’s try doing a search and see if we can reverse the URL instead. I’m skeptical this will work because of the sheer number of variables involved, but let’s see. I’m going to specify a search for lastname = Taylor, company = Boeing and the constraint that it’s the current company only.
The resultant URL:
Rather to my surprise, this does work! You can see that last name is “lname”, company is “company” and that “currentCompany” is the restriction parameter. Nice!
My first question at this point is whether we can simply delete all the other criteria and have it work properly:
Nope. Too much removed and the search didn’t work.
Through some experimentation, I have ascertained that this is the minimal set of criteria needed to be specified for the search to work:
Now it’s a matter of figuring out which of these values we want to let vary and which we want to keep constant. We also need to add a first name option, which proves to be “fname”, no surprise.
Unwrapping everything, we now know that we need:
- “search=” — to have it work properly
- “lname=last name” — the last name we’re using as a search value
- “distance=-1″ — since there’s no default value for distance from our location, “-1″ specifies that LinkedIn should ignore geographic constraints.
- “company=company name” — this will be a set value, the name of your company.
- “currentCompany=co” — constrains search to just people who work at the company today, not those that have worked there in the past.
There’s one more thing we can ascertain from examining this URL: the address of the search engine itself. That’s everything before the “?” in the URL: “http://www.linkedin.com/search”.
Now we can create our own rough HTML form that uses hidden variables for things we don’t want to vary and regular text input boxes for those we do:
<input type=”hidden” name=”search” value=”” />
firstname: <input type=”text” name=”fname” />
lastname: <input type=”text” name=”lname” />
<input type=”hidden” name=”distance” value=”-1″ />
<input type=”hidden” name=”company” value=”boeing” />
<input type=”hidden” name=”currentCompany” value=”co” />
<input type=”submit” value=”search LinkedIn” />
It looks like this:
It’s not pretty, but if you try it you’ll find that it does indeed work as a simple way to search for Boeing employees at LinkedIn.
That’s the core of what you need for your project. I hope it works out for you!