# # Copyright (c) 2005 Richard Cameron, CiteULike.org # All rights reserved. # # This code is derived from software contributed to CiteULike.org # by # Will Wade # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by # CiteULike and its # contributors. # 4. Neither the name of CiteULike nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY CITEULIKE.ORG AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # Each plugin needs a description so the driver can advertise the details # to the users on the site plugin { # Integer version number for the plugin code. When this number is incremented, # CiteULike may reparse all existing articles with the new code. version {1} # The name of the plugin, as displayed on the "CiteULike supports..." page name {BMJ} # The link the front page of this service url {http://bmj.bmjjournals.com} # Any additional information which needs to be displayed to the user. # E.g. "Experimental support" blurb {} # Your name author {Will Wade} # Your email address email {willwade@gmail.com} # Language you wrote the plugin in language {perl} # Regular expression to match URLs that the plugin is # *potentially* interested in. Any URL matching this regexp # will cause your parser to be invoked. Currently, this will # require fork()ing a process, so you should try to reduce the number # of false positives by making your regexp as restrictive as possible. # # If it is not possible to determine whether or not your plugin is # interested purely on the basis of the URL, you will have a chance # to refine this decision in your code. For now, try to make a reasonable # approximation - like, check for URLs on the right hostname # # Note: Some universities provide mirrors of commericial publishers' sites # with different hostnames, so you should provide some leeway in your # regexp if that applies to you. # # Nature have two styles of URLs for their articles.. they seem to be slowly # moving to the second. regexp {([^/]+).bmjjournals.com/cgi/content/([^/]+)/([0-9]+)/([0-9]+)/([0-9a-zA-Z-]+)} } # bmj.bmjjournals.com/cgi/content/full/330/7499/1049 # bmj.bmjjournals.com/cgi/content/abstract/330/7499/1049 # bmj.bmjjournals.com/cgi/content/extract/330/7499/1049 # bmj.bmjjournals.com/cgi/content/abstract/bmj.38498.669595.8Fv1 !!!! NOt working # bjsm.bmjjournals.com/cgi/content/abstract/39/4/22 # # Linkout formatting # # CiteULike doesn't store URLs for articles. # Instead it stores the raw ingredients required to build the dynamically. # Each plugin is required to define a small procedure which does this formatting # See the HOWTO file for more details. # # The variables following variables are defined for your use # in the function: type ikey_1 ckey_1 ikey_2 ckey_2 # format_linkout BMJJ { # Need to turn the following (example) fields into a URL: #type=BMJ #ikey_1=330 #ckey_1=7499,1049 #ikey_2= #ckey_2=bmj set l [split $ckey_1 ","] set vol [lindex $l 0] set page [lindex $l 1] return [list "BMJ (PDF version)" \ "http://${ckey_2}.bmjjournals.com/cgi/content/reprint/${ikey_1}/${vol}/${page}" \ "BMJ (HTML version)"\ "http://${ckey_2}.bmjjournals.com/cgi/content/full/${ikey_1}/${vol}/${page}"] } # # TESTS # # Each plugin MUST provide a set of tests. The motivation behind this is # that web scraping code is inherently fragile, and is likely to break whenever # the provider decides to redisign their site. CiteULike will periodically # run tests to see if anything has broken. # Please provide as comprehensive a set of tests as possible. # If you ever fix a bug in the parser, it is highly recommended that # you add the offending page as a test case. test {http://bmj.bmjjournals.com/cgi/content/abstract/330/7499/1049} { formatted_url {{BMJ (PDF version)} http://bmj.bmjjournals.com/cgi/content/reprint/330/7499/1049} formatted_url {{BMJ (HTML version)} http://bmj.bmjjournals.com/cgi/content/full/330/7499/1049} formatted_url {DOI http://dx.doi.org/10.1136/bmj.38414.422650.8F} formatted_url {Pubmed http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15817527} formatted_url {Hubmed http://www.hubmed.org/display.cgi?uids=15817527} linkout {BMJJ 330 7499,1049 {} bmj} linkout {DOI {} 10.1136/bmj.38414.422650.8F {} {}} linkout {PMID 15817527 {} {} {}} volume 330 year 2005 type JOUR start_page 1049 issue 7499 title {Comparison of descriptions of allocation concealment in trial protocols and the published reports: cohort study} journal BMJ url {http://www.bmj.com/cgi/content/abstract/330/7499/1049} author {Pildal Julie J {Pildal, Julie}} author {Chan An-Wen A {Chan, An-Wen}} author {Hrobjartsson Asbjorn A {Hrobjartsson, Asbjorn}} author {Forfang Elisabeth E {Forfang, Elisabeth}} author {Altman Douglas DG {Altman, Douglas G}} author {Gotzsche Peter PC {Gotzsche, Peter C}} month 5 day 7 status ok abstract {Objectives To compare how allocation concealment is described in publications of randomised clinical trials and corresponding protocols, and to estimate how often trial publications with unclear allocation concealment have adequate concealment according to the protocol. Design Cohort study of 102 sets of trial protocols and corresponding publications. Setting Protocols of randomised trials approved by the scientific and ethical committees for Copenhagen and Frederiksberg, 1994 and 1995. Main outcome measures Frequency of adequate, unclear, and inadequate allocation concealment and sequence generation in trial publications compared with protocols, and the proportion of protocols where methods were reported to be adequate but descriptions were unclear in the trial publications. Results 96 of the 102 trials had unclear allocation concealment according to the trial publication. According to the protocols, 15 of these 96 trials had adequate allocation concealment (16%, 95% confidence interval 9% to 24%), 80 had unclear concealment (83%, 74% to 90%), and one had inadequate concealment. When retrospectively defined loose criteria for concealment were applied, 83 of the 102 trial publications had unclear concealment. According to their protocol, 33 of these 83 trials had adequate allocation concealment (40%, 29% to 51%), 49 had unclear concealment (59%, 48% to 70%), and one had inadequate concealment. Conclusions Most randomised clinical trials have unclear allocation concealment on the basis of the trial publication alone. Most of these trials also have unclear allocation concealment according to their protocol. 10.1136/bmj.38414.422650.8F} } # Test the thing when there's extra junk on the end of the URL (E.g: ?ehom) test {http://bmj.bmjjournals.com/cgi/content/abstract/330/7506/1457?ehom} { linkout {BMJJ 330 7506,1457 {} bmj} linkout {DOI {} 10.1136/bmj.330.7506.1457 {} {}} linkout {PMID 15976393 {} {} {}} formatted_url {{BMJ (PDF version)} http://bmj.bmjjournals.com/cgi/content/reprint/330/7506/1457} formatted_url {{BMJ (HTML version)} http://bmj.bmjjournals.com/cgi/content/full/330/7506/1457} formatted_url {DOI http://dx.doi.org/10.1136/bmj.330.7506.1457} formatted_url {Pubmed http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15976393} formatted_url {Hubmed http://www.hubmed.org/display.cgi?uids=15976393} volume 330 issue 7506 start_page 1457 end_page 1458 year 2005 month 6 day 25 title {Hysterectomy for benign conditions} journal BMJ author {Edozien Leroy LC {Edozien, Leroy C}} type JOUR url http://www.bmj.com abstract {10.1136/bmj.330.7506.1457} status ok } # Slightly non-standard page number test {http://bmj.bmjjournals.com/cgi/content/full/330/7506/0-g?ehom} { linkout {BMJJ 330 7506,0-g {} bmj} linkout {DOI {} 10.1136/bmj.330.7506.0-g {} {}} formatted_url {{BMJ (PDF version)} http://bmj.bmjjournals.com/cgi/content/reprint/330/7506/0-g} formatted_url {{BMJ (HTML version)} http://bmj.bmjjournals.com/cgi/content/full/330/7506/0-g} formatted_url {DOI http://dx.doi.org/10.1136/bmj.330.7506.0-g} volume 330 year 2005 month 6 day 25 type JOUR start_page 0-g journal BMJ title {Performance matters} author {Godlee Fiona F {Godlee, Fiona}} issue 7506 url http://www.bmj.com abstract {10.1136/bmj.330.7506.0-g} status ok } # From a search result, with some interesting other junk on the end test {http://bmj.bmjjournals.com/cgi/content/full/329/7475/1188-c/DC1?maxtoshow=&HITS=10&hits=10&RESULTFORMAT=1&author1=cameron&andorexacttitle=and&andorexacttitleabs=and&andorexactfulltext=and&searchid=1120043717953_4754&stored_search=&FIRSTINDEX=0&sortspec=relevance&resourcetype=1,2,3,4} { linkout {BMJJ 329 7475,1188-c {} bmj} linkout {DOI {} 10.1136/bmj.329.7475.1188-c {} {}} formatted_url {{BMJ (PDF version)} http://bmj.bmjjournals.com/cgi/content/reprint/329/7475/1188-c} formatted_url {{BMJ (HTML version)} http://bmj.bmjjournals.com/cgi/content/full/329/7475/1188-c} formatted_url {DOI http://dx.doi.org/10.1136/bmj.329.7475.1188-c} volume 329 issue 7475 year 2004 type JOUR start_page 1188-c url http://www.bmj.com month 11 day 13 title {Graham George Haigh} journal BMJ abstract {10.1136/bmj.329.7475.1188-c} author {Cameron Gordon G {Cameron, Gordon}} status ok } # Really old article - make sure they provide 'export to citation manager' # for historic stuff too # This one doesn't have a DOI # Doesn't have PDF linkout.. but I don't think it's possible to determine # this without too much effort. test {http://bmj.bmjjournals.com/cgi/content/full/309/6970/1686?maxtoshow=&HITS=10&hits=10&RESULTFORMAT=1&andorexacttitle=and&andorexacttitleabs=and&andorexactfulltext=and&searchid=1120044557327_5038&stored_search=&FIRSTINDEX=0&sortspec=relevance&resourcetype=1,2,3,4} { linkout {BMJJ 309 6970,1686 {} bmj} linkout {PMID 7819986 {} {} {}} formatted_url {{BMJ (PDF version)} http://bmj.bmjjournals.com/cgi/content/reprint/309/6970/1686} formatted_url {{BMJ (HTML version)} http://bmj.bmjjournals.com/cgi/content/full/309/6970/1686} formatted_url {Pubmed http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=7819986} formatted_url {Hubmed http://www.hubmed.org/display.cgi?uids=7819986} volume 309 issue 6970 year 1994 day 24 month 12 journal BMJ type JOUR start_page 1686 end_page 1688 url http://www.bmj.com/cgi/content/abstract/309/6970/1686 author {Campbell Moran MEJ {Campbell, E J Moran}} author {Campbell Diana DM {Campbell, Diana M E}} author {Roberts Robin RS {Roberts, Robin S}} title {Ability to distinguish whisky (uisge beatha) from brandy (cognac)} status ok } # One of BMJ's sister sites # test {http://bjsm.bmjjournals.com/cgi/content/abstract/39/4/223} { formatted_url {{BMJ (PDF version)} http://bjsm.bmjjournals.com/cgi/content/reprint/39/4/223} formatted_url {{BMJ (HTML version)} http://bjsm.bmjjournals.com/cgi/content/full/39/4/223} formatted_url {Pubmed http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15793092} formatted_url {Hubmed http://www.hubmed.org/display.cgi?uids=15793092} linkout {BMJJ 39 4,223 {} bjsm} linkout {PMID 15793092 {} {} {}} volume 39 year 2005 type JOUR start_page 223 end_page 225 issue 4 title {A controlled study on batted ball speed and available pitcher reaction time in slowpitch softball} journal {Br J Sports Med} url {http://bjsm.bmj.com/cgi/content/abstract/39/4/223} author {Mcdowell {} M {McDowell, M}} author {Ciocco {} MV {Ciocco, M V}} month 4 day 1 abstract {Objectives: To investigate safety risks in slowpitch softball by conducting laboratory and experimental studies on the performance of high tech softball bats with polyurethane softballs. To compare the results with the recommended safety standards. Methods: ASTM standard compression testing of seven softball models was conducted. Using these seven softball models, bat/ball impact testing was performed using seven adult male softball players and six high tech softball bat models to determine mean batted ball speeds. Over 500 bat/ball impact measurements were recorded and analysed. Available pitcher reaction time was calculated from the mean batted ball speed measurements. Results: According to the United States Specialty Sports Association and the Amateur Softball Association, the maximum initial batted ball speed should be 137.2 km/h, which corresponds to a minimum pitcher reaction time of 0.420 second. These experiments produced mean batted ball speeds of 134.0-159.7 km/h, which correspond to available pitcher reaction times of 0.409-0.361 second. Conclusion: The use of high tech softball bats with polyurethane softballs can result in batted ball speeds that exceed the recommended safety limits, which correspond to decreased available pitcher reaction times. 10.1136/bjsm.2004.012724} status ok } # # Weird exception where the journal "ip" needs to be translated into # "injury prevention" in order to get the RIS record test {http://ip.bmjjournals.com/cgi/content/full/7/2/166-a} { volume 7 linkout {BMJJ 7 2,166-a {} ip} linkout {PMID 11428567 {} {} {}} year 2001 type JOUR start_page 166-a url http://injuryprevention.bmj.com day 1 formatted_url {{BMJ (PDF version)} http://ip.bmjjournals.com/cgi/content/reprint/7/2/166-a} formatted_url {{BMJ (HTML version)} http://ip.bmjjournals.com/cgi/content/full/7/2/166-a} formatted_url {Pubmed http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=11428567} formatted_url {Hubmed http://www.hubmed.org/display.cgi?uids=11428567} title {Scooter injuries to children} journal {Inj Prev} author {Stokes {} M {Stokes, M}} author {Corbo {} MP {Corbo, M P}} abstract {10.1136/ip.7.2.166-a} month 6 issue 2 status ok }