My Connotea library was getting littered with numerous duplicate copies of the same Pubmed abstract. Because Pubmed URLs often contain session specific info like query_hl=10, the same abstract from 2 different sessions would get added twice to my library. So I googled for "javascript tutorial" and then hacked the bookmarklet javascript to strip off the PMID from the URL and construct a new minimal URL in a consistent format to send to connotea. Another advantage of this bookmarklet is that in cases where a pubmed search returns only one abstract, the PMID is not in the URL at all (for instance, this search: search pubmed for term connotea). In this case, I can highlight the PMID on the page and then clicking the bookmarklet constructs the URL with the highlighted PMID and sends it to Connotea.

Copying and pasting the modified javascript below into the address field of the existing connotea bookmarklet should do the job:

javascript:u=location.href;a=false;x=window;e=x.encodeURIComponent;d=document;if(u.indexOf("http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?")>-1){ tt=d.getSelection(); len=tt.length; if(len>0){newVariable="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&list_uids="+tt;}else{urlArray=u.split("&");newVariable="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed";for(ind=1;ind-1){newVariable=newVariable+"&"+tempString;}}}u=newVariable;w=open('http://www.connotea.org/addpopup?continue=confirm&uri='+e(u)+'&title='+e(d.title),'add','width=660,height=600,scrollbars,resizable');void(x.setTimeout('w.focus()',200));}else{if((s=d.selection)?t=s.createRange().text:t=x.getSelection()+'')(r=/(doi:)?\s?(10\.\d{4}\/\S+)/.exec(t))?u='http://dx.doi.org/'+r[2]:a=true;a?alert('Please highlight a full DOI, or deselect text to add this page.'):w=open('http://www.connotea.org/addpopup?continue=confirm&uri='+e(u)+'&title='+e(d.title),'add','width=660,height=600,scrollbars,resizable');void(x.setTimeout('w.focus()',200));}

The "for" loop above can be replaced by a regular expression, but this was a one-hour hack after learning javascript from scratch, and it works for me, for now.

Comments, code fixes and bug reports most welcome (!).