Wednesday, February 2, 2011

Populate LinkedIn Publications using PubMed IDs

Note:  The LinkedIn-PubMed script has been updated and is discussed here.

LinkedIn now gives you the ability to add publications to your LinkedIn profile. Currently, each publication must be added manually including title, author list, data, abstract, etc. which can be a real drag if you need to enter more than a couple publications. If you're a Firefox user, you can use this simple script to fill in publication data by entering only a PubMed ID.

To install the script:
  1. Install the GreaseMonkey Firefox extension by going here and hitting "Add to Firefox".
  2. Install the LinkedIn-PubMed ID Lookup script by going here and hitting "Install".
  3. Edit your profile on the LinkedIn site and go down to the link that says "Add a publication". This link will come after your "Experience" section.
  4. You should see at the top of the form an input box for PubMed ID. Enter your id and hit the search button. The form should be filled out with the publication information as acquired from PubMed. If you're happy with the results, hit submit. Otherwise, edit to your liking and hit submit.

Here are screen shots of what the LinkedIn page looks like before you install the script:



and after:



Here's what the form looks like after submitting a PubmedId:



Some Technical Details

I imagine it's only a matter of time before LinkedIn adds PubMed look up or an equivalent convenience, so I didn't want to invest a huge amount of time in this endeavor. GreaseMonkey was a natural choice as it's designed for the task of enhancing existing web sites and doing mash-ups. In this case, I needed to make calls out to Entrez's EFetch, parse the XML response and populate the fields in the LinkedIn form. GreaseMonkey made the PubMed look up a snap, as its GM_xmlhttpRequest method allows for cross-site http requests, something normal JavaScript disallows for security reasons. GreaseMonkey scripts are written in JavaScript and I also brought in jQuery to facilitate manipulating the website's DOM.

As it turned out, the hardest part of the whole project was dealing with the author list. First, LinkedIn automatically includes the LinkedIn user's name in the authors list, so I needed to try to identify and remove the user in the authors reported by PubMed so that it wouldn't appear twice. My simple minded check has been working for my publications, but will surely slip up in some harder cases. The second problem was working with LinkedIn's own JavaScript used to make the author list dynamically increase or decrease as authors get added. In the end, blowing away their scripting and replacing it with my own seemed like the most expedient route. I borrowed heavily from their code to do this and the end result is a bit of an ugly jQuery/straight DOM jumble.

I was able to successfully enter all my publications, but I am certain there will be instances where it falls flat. Let me know how it works for you!

13 comments:

Anonymous said...

Lots of beneficial reading here, thanks! I had been browsing on yahoo when I observed your article, I’m going to add your feed to Google Reader, I look forward to much more from you.

Greg Benison said...

A useful script - I used it today. Thanks!

Anonymous said...

Just downloaded and used it today. Worked fine for my publications! Nice script!

valegiĆ² said...

thank you!!! it's very very usefull! Now I hope Linkedin alloew us to change authors order !

Valentina said...

Very very usefull!!!! Thank you!!!!

Herve said...

Nice idea, but I tried in both Firefox and Chrome with GreaseMonkey plugins install... and sadly it does not work (probably due to new version of web browser or page on linkedin not being the one recognise by the script...) shame, because it was an excellent idea!!

Herve said...

I tried it in both Firefox and Chrome with GreaseMonkey installed and it does not work anymore, probably due to new version of the web browser or linkedin pages... shame because it is extremely useful!!

mr.AA said...

Hi Herve,

I was afraid that the new changes in LinkedIn might break things. I'll work on this over the weekend and post an update.

Thanks for letting me know about the issue!

Thx,
-AA

py shih said...

I meet same issue as Herve. It doesn't work now...

py shih said...

I meet same issue as Herve. It doesn't work now...

mr.AA said...

I just uploaded an update at userscripts.org. It should now work with LinkedIn's new profiles. I also added DOI lookups.

Please let me know if you run into any problems.

Thanks!
-AA

Skye said...

I have only one publication out there an I'm the fourth author and I would like to add it to my Linkedin account. You seem like you have some experience in this field, here is my question: What is the graceful way to add a publication to linkedin so that I don't look like the first author?

Thanks,
Skye

mr.AA said...

Hi Skye,

Yes, it's a shame LinkedIn doesn't preserve author order. I'm no expert, but here are two philosophies:
1. Folks that use LinkedIn will know about this shortcoming and won't fault you for appearing first, or
2. I've seen some folks include in the Description section a disclaimer saying that they are not first author and that this is LinkedIn's behavior.

Hope that helps!
-AA