Changeset 1179 for trunk


Ignore:
Timestamp:
Feb 17, 2014, 6:19:02 PM (11 years ago)
Author:
aslmd
Message:

BIBWEB python. various improvements: big LMD script, teams, no year without pubs, pub counts, verbose mode.

Location:
trunk/UTIL/PYTHON/bibweb
Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/bibweb/ads.py

    r1142 r1179  
     1#-*- coding: utf8 -*-
    12import os, re, urllib
    23
    34## -----------------------------------------------------------------
    45## Purpose: make a nice publication page with an ADS database link
    5 ## Author: Aymeric Spiga 19/05/2013 improvements 10-12/2013
     6## Author: Aymeric Spiga 19/05/2013 improvements 10-12/2013 counts 02/2014
    67## -----------------------------------------------------------------
    78## NB: uses BIBTEX2HTML https://www.lri.fr/~filliatr/bibtex2html/doc/manual.html
    89## ... and of course NASA ADS http://adsabs.harvard.edu/
    910## -----------------------------------------------------------------
     11
     12def printpubli(num):
     13    if num == 1: char = "%.0f publication" % (num)
     14    else: char = "%.0f publications" % (num)
     15    return char
    1016
    1117def makepage(authorref,
     
    1925             addpdf = None,
    2026             addlink = None,
    21              target=None):
    22 
     27             printnum = False,
     28             verbose = True,
     29             target = None):
     30
     31    htmlcontent1 = ""
     32    htmlcontent2 = ""
    2333    htmlcontent = ""
    2434   
     
    2636    if embedded:
    2737     htmlfile = open('header.html','r')
    28      htmlcontent = htmlfile.read()
     38     htmlcontent1 = htmlfile.read()
    2939     htmlfile.close()
    3040    #else:
    3141    if title is None:
    32       htmlcontent = htmlcontent + "<h2>"+authorref+"'s publications</h2>"
     42      htmlcontent1 = htmlcontent1 + "<h2>"+authorref+"'s publications</h2>"
    3343    elif title == "":
    3444      pass
    3545    else:
    36       htmlcontent = htmlcontent + title
     46      htmlcontent1 = htmlcontent1 + title
    3747   
    3848    ### if linkads is None, we set it to "link.authorref"
     
    4252    ### GET INFO FROM ADS
    4353    if retrieve:
    44       print "retrieving info from ADS"
     54      if verbose: print "retrieving info from ADS"
    4555      linkfile = open(linkads,'r')
    4656      url = linkfile.read()
    4757      linkfile.close()
    4858      html = urllib.urlopen(url).read()
     59      ## fix problem with accents
     60      find = re.compile(r"{\\'e}")
     61      html = find.sub('é',html)
     62      find = re.compile(r"{\\`e}")
     63      html = find.sub('è',html)
     64      ##
    4965      bibfile = open(linkads+'.bib','w')
    5066      print >> bibfile,html
    5167      bibfile.close()
    52     
     68   
    5369    ### if only one year and no customcond, make it useful. ask for years >= this value
    5470    if len(listyear) == 1 and customcond is None:
     
    5672        listyear[0] = 99
    5773   
    58     ### ADD LINK WITH YEARS IN HEADER
    59     if customcond is None or len(listyear) > 1:
    60         htmlcontent += "Year: "
    61         for year in listyear:
    62           htmlcontent += "<a href='#"+str(year)+"'>"+str(year)+"</a>.  "
    63         if addlink is not None: htmlcontent += "<br>"+addlink
    64    
    6574    ### YEAR LOOP
     75    numpublitot = 0 ; nonzeroyears = []
    6676    for year in listyear:
    6777   
    6878        author = authorref+str(year)
    69         print author
    7079   
    7180        # 0. define condition
     
    8493              author+'.bib',\
    8594              linkads+'.bib'
    86         cmd = "bib2bib --quiet %s -c '$type=%s' -oc %s -ob %s %s" % (arg)
     95        cmd = "bib2bib --quiet %s -c '$type=%s' -oc %s -ob %s %s >> /dev/null 2>> /dev/null" % (arg)
    8796        os.system(cmd)
     97
     98        # count number of publications (both per year and increment total)
     99        numpubli = len(open(author+'.txt', 'r').readlines())
     100        if verbose: print "%s --> count: %.0f" % (author,numpubli)
     101        numpublitot += numpubli
     102        # record years with publications
     103        if numpubli == 0: continue
     104        else: nonzeroyears.append(year)
    88105
    89106        # modify the bib file to insert pdf links
     
    111128           header = '<a name="%.0f"></a>' % (year)
    112129           header += "<h3>%.0f <a href=''>.</a> </h3>" % (year)
     130           if printnum: header += "("+printpubli(numpubli)+")"
    113131           if embedded: header += '<br>'
    114132        else:
    115133           header = ''
     134           if printnum: header += "("+printpubli(numpubli)+")"
    116135   
    117136        header = '"'+header+'"'
     
    129148              -nofooter --nodoc \
    130149              --header %s -nokeywords \
    131               %s" % (arg)
     150              %s >> /dev/null 2>> /dev/null" % (arg)
    132151        os.system(cmd)
    133152
     
    166185      htmlcontent += htmlfile.read()
    167186      htmlfile.close()
    168      
     187
     188    ### TREAT HEADER PART DEPENDENT ON PREVIOUS LOOP
     189    ### -- total publications + list of years
     190    if customcond is None or len(listyear) > 1:
     191        if len(nonzeroyears) == 0:
     192          htmlcontent2 += "No publications found."
     193        else:
     194          htmlcontent2 += "Year: "
     195          for year in nonzeroyears:
     196            htmlcontent2 += "<a href='#"+str(year)+"'>"+str(year)+"</a>.  "
     197          if addlink is not None: htmlcontent2 += "<br>"+addlink
     198          if printnum: htmlcontent2 += "<p>(Total: "+printpubli(numpublitot)+")</p>"
     199
     200    ### PUT EVERYTHING TOGETHER AND CREATE A PAGE
     201    htmlcontent = htmlcontent1 + htmlcontent2 + htmlcontent
    169202    htmlmain = open(authorref+'.html','w')
    170203    print >> htmlmain, htmlcontent
     
    176209      arg = target,\
    177210          authorref+"*.html",\
     211          target,\
    178212          authorref+"*.bib",\
    179213          authorref+"*.txt",\
    180           target,\
    181214          target+linkads+".bib",\
    182215          "*.css",\
    183216          target
    184       os.system( "mkdir -p %s ; mv %s %s %s %s ; mv %s ./ 2> /dev/null ; cp %s %s 2> /dev/null" % (arg) )
     217      os.system( "mkdir -p %s ; mv %s %s ; rm -rf %s %s ; mv %s ./ 2> /dev/null ; cp %s %s 2> /dev/null" % (arg) )
  • trunk/UTIL/PYTHON/bibweb/biglmdwebsite/listjournals.txt

    r1143 r1179  
    11A&A
    22ACP
    3 ACPD
    43AdSpR
     4AMT
    55AnGeo
    66AnGla
    77ApOpt
     8ApJ
    89AtmEn
    910AtmRe
     
    1112BAAS
    1213BAMS
     14BGeo
    1315BoLMe
    1416Chaos
    1517ClDy
     18CliPa
    1619CRASB
    1720CRASE
     
    2124E&ES
    2225E&PSL
     26EMS
    2327ERL
    2428FizAO
     29GeCAS
    2530GeoRL
    2631GApFD
    27 GID
    2832GI
    2933GMS
     34GMD
    3035QJRMS
    3136Icar
     37IJAsB
    3238IJCli
    3339IJMSE
     40IJRS
    3441InPhT
     42ITGRS
    3543IzAOP
    3644JAMES
    3745JApMC
     46JApMe
    3847JAtOT
    3948JAtS
     
    4352JGRD
    4453JGRE
     54JGRG
     55JMoSp
     56JMR
    4557JMTAS
    4658JPO
     59JQRST
    4760LNP
    4861MAP
    4962MWRv
     63NatCC
     64NatCo
    5065NatGe
    5166Natur
    5267NCimC
    5368NHESS
     69Nonli
    5470NPGeo
    5571OcDyn
     
    5773OptEn
    5874P&SS
     75PCEB
    5976PhFl
    6077PhLA
    6178PhRvL
     79PhT
    6280PhyD
     81PNAS
    6382QJRMS
     83QSRv
     84RCD
     85REC
    6486RSPTA
    6587RvGeo
    6688Sci
     89TCry
     90Tell
    6791TellA
     92TellB
     93WIRCC
     94WRR
     95WtFor
  • trunk/UTIL/PYTHON/bibweb/biglmdwebsite/listpeople.txt

    r1143 r1179  
    1 ----------------------------------------------------------------------------------------------------
     1-----------http://lite3.framapad.org/p/YTTXcVSXCL---------------------------------------------------
    22NOM ; PRENOM ; INITIALES ; EQUIPE ; ANNEE DEBUT ; ANNEE FIN (0000 si présent) ; NOM 2 ('-' si aucun)
    33----------------------------------------------------------------------------------------------------
     4Armante ; Raymond ; R. ; ABCT ; 1995 ; 0000 ; -
     5Arsouze ; Thomas ; T. ; INTRO ; 2013 ; 0000 ; -
     6Basdevant ; Claude ; C. ; DPAO ; 1971 ; 0000 ; -
     7Bonazzola ; Marine ; M. ; EMC3 ; 1999 ; 0000 ; -
    48Bony ; Sandrine ; S. ; EMC3 ; 1990 ; 0000 ; - 
     9Boucher ; Olivier ; O. ; EMC3 ; 1995 ; 0000 ; -
     10Capelle ; Virginie ; V. ; ABCT ; 2008 ; 0000 ; -
     11Chedin ; Alain ; A. ; ABCT ; 1971 ; 0000 ; Chédin
     12Chepfer ; Helene ; H. ; INTRO ; 1998 ; 0000 ; -
     13Cheruy ; Frédérique ; F. ; EMC3 ; 1988 ; 0000 ; -
     14Claud ; Chantal ; C. ; DPAO ; 1992 ; 0000 ; -
     15Codron ; Francis ; F. ; EMC3 ; 2000 ; 0000 ; -
    516Drobinski ; Philippe ; P. ; INTRO ; 2003 ; 0000 ; -
     17Dubos ; Thomas ; T. ; INTRO ; 2007 ; 0000 ; -
     18Dufresne ; Jean-Louis ; J.-L. ; EMC3 ; 1985 ; 0000 ; -
     19Duvel ; Jean-Philippe ; J.-P. ; DPAO ; 1990 ; 0000 ; -
    620Crevoisier ; Cyril ; C. ; ABCT ; 2002 ; 0000 ; -
    7 Flamant ; Pierre ; P. ; ABCT ; 1976 ; 0000 ; -
     21Edouard ; Dimitri ; D. ; ABCT ; 2002 ; 0000 ; -
     22Farge ; Marie ; F. ; DPAO ; 1990 ; 0000 ; -
     23Flamant ; Pierre ; P. ; ABCT ; 1964 ; 0000 ; -
    824Forget ; François ; F. ; PLANETO ; 1993 ; 0000 ; -
    9 Gibert ; Fabien ; F. ; ABCT ; 2006 ; 0000 ; -
    10 Hourdin ; Frédéric ; F. ; EMC3 ; 1992 ; 0000 ; -
    11 Lapeyre ; Guillaume ; G. ; DPAO ; 1999 ; 0000 ; -
    12 Lebonnois ; Sébastien ; S. ; PLANETO ; 1999 ; 0000 ; -
     25Gay-Balmaz ; François ; F. ; DPAO ; 2011 ; 0000 ; -
     26Gibert ; Fabien ; F. ; ABCT ; 2003 ; 0000 ; -
     27Goulas ; Yves ; Y. ; ABCT ; 1990 ; 0000 ; -
     28Grandpeix ; Jean-Yves ; J.-Y. ; EMC3 ; 1990 ; 0000 ; -
     29Hertzog ; Albert ; A. ; DPAO ; 1999 ; 0000 ; -
     30Hourdin ; Frédéric ; F. ; EMC3 ; 1992 ; 0000 ; -
     31Jacquinet-Husson ; Nicole ; N. ; ABCT ; 1971 ; 0000 ; -
     32Lapeyre ; Guillaume ; G. ; DPAO ; 2004 ; 0000 ; -
     33Laval ; Katia ; K. ; EMC3 ; 1970 ; 0000 ; -
     34Lebonnois ; Sébastien ; S. ; PLANETO ; 1999 ; 0000 ; -
     35Legras ; Bernard ; B. ; DPAO ; 1984 ; 0000 ; -
     36Le Mounier ; Florian ; F. ; ABCT ; 2011 ; 0000 ; -
     37Li ; Zhao-Xin ; Z.-X. ; EMC3 ; 1988 ; 0000 ; -
     38Lott ; François ; F. ; DPAO ; 1995 ; 0000 ; -
    1339Madeleine ; Jean-Baptiste ; J.-B. ; EMC3 ; 2009 ; 0000 ; -
     40Mailler ; Sylvain ; S. ; INTRO ; 2009 ; 0000 ; -
    1441Menut ; Laurent ; L. ; INTRO ; 1999 ; 0000 ; -
     42Moya ; Ismael ; I. ; ABCT ; 1973 ; 0000 ; -
     43Ounis ; Abderrahmane ; A. ; ABCT ; 2001 ; 0000 ; -
     44Noel ; Vincent ; V. ; INTRO ; 1999 ; 0000 ; -
     45Picon ; Laurence ; L. ; EMC3 ; 1985 ; 0000 ; -
     46Plougonven ; Riwal ; R. ; DPAO ; 2005 ; 0000 ; -
     47Polcher ; Jan ; J. ; INTRO ; 2013 ; 0000 ; -
    1548Rio ; Catherine ; C. ; EMC3 ; 2000 ; 0000 ; -
    1649Risi ; Camille ; C. ; EMC3 ; 2006 ; 0000 ; -
     50Riviere ; Gwendal ; G. ; DPAO ; 2014 ; 0000 ; Rivière
    1751Sadourny ; Robert ; R. ; LEGACY ; 1968 ; 2002 ; -
    18 Scott ; Noëlle ; N. ; ABCT ; 1981 ; 0000 ; -
     52Scott ; Noëlle ; N.A. ; ABCT ; 1971 ; 0000 ; -
     53Seze ; Geneviève ; G. ; EMC3 ; 1987 ; 0000 ; Sèze
     54Speich ; Sabrina ; S. ; DPAO ; 2014 ; 0000 ; -
    1955Spiga ; Aymeric ; A. ; PLANETO ; 2007 ; 0000 ; -
    20 Stubenrauch ; Claudia ; C. ; ABCT ; 1994 ; 0000 ; -
     56Stegner ; Alexandre ; A. ; DPAO ; 2001 ; 0000 ; -
     57Stubenrauch ; Claudia ; C.J. ; ABCT ; 1996 ; 0000 ; -
     58Talagrand ; Olivier ; O. ; DPAO ; 1970 ; 0000 ; -
     59Teitelbaum ; Hector ; H. ; DPAO ;  1970 ; 0000 ; -
     60Turquety ; Solene ; S. ; INTRO ; 2008 ; 0000 ; -
     61Valari ; Myrto ; M. ; INTRO ; 2008 ; 0000 ; -
     62Vial ; François ; F. ; DPAO ; 1987 ; 0000 ; -
    2163Zeitlin ; Vladimir ; V. ; DPAO ; 1991 ; 0000 ; Tseitlin
  • trunk/UTIL/PYTHON/bibweb/biglmdwebsite/lmdall.py

    r1144 r1179  
    88# Aymeric SPIGA
    99# Laboratoire de Météorologie Dynamique
    10 # 15-20/12/2013
     10# 15-20/12/2013. teams 01/2014.
    1111##########################################
    1212
     
    1515titsuf = "</font></EM></H2></CENTER>" # title suffix
    1616anneec = 2014 # last year to include
     17oneyear = None
     18#oneyear = 2013
     19usercond = None
     20usercond = ''' -c 'not journal:"Discussions"' ''' # fixes the EGU Discussions journals problem
    1721####
    1822
    19 #cc = ''' -c ' '''
    20 #cc = cc+' author:"Forget"'
    21 #cc = cc+' or author:"Lebonnois"'
    22 #cc = cc+' or author:"Spiga"'
    23 #cc = cc+' or author:"Madeleine"'
    24 #cc = cc+''' ' '''
    25 #eq = 'PLANETO'
    26 #ads.makepage('pub'+eq,retrieve=True,listyear=years,linkads=link,customcond = cc,\
    27 #title = "<CENTER><H2><EM><font color='#B8860B;'>EQUIPE "+eq+"</font></EM></H2></CENTER>")
    28 
    29 
    30 
    31 
    32 
    33 
     23### FOLDER
     24folder = "/home/marshttp/www-mars/publmdall"
     25if oneyear is not None: folder = folder + str(oneyear)
    3426
    3527### CLEAN
    36 os.system('rm -rf lmdall')
     28os.system('rm -rf '+folder)
    3729
    3830### GET TEAM LIST and SIZE
    39 nom,prenom,initiales,equipe,anneedeb,anneefin,altnom = np.loadtxt("listpeople.txt",delimiter=";",dtype='string',unpack=True,skiprows=3,comments="#")
    40 ntot = nom.size
     31tnom,tprenom,tinitiales,tequipe,tanneedeb,tanneefin,taltnom = np.loadtxt("listpeople.txt",delimiter=";",dtype='string',unpack=True,skiprows=3,comments="#")
    4132
    42 ### PREPARE ADS LINK
    43 # 1. generic parts
    44 adslink1="http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&db_key=PHY&db_key=PRE&qform=PHY&arxiv_sel=astro-ph&arxiv_sel=cond-mat&arxiv_sel=cs&arxiv_sel=gr-qc&arxiv_sel=hep-ex&arxiv_sel=hep-lat&arxiv_sel=hep-ph&arxiv_sel=hep-th&arxiv_sel=math&arxiv_sel=math-ph&arxiv_sel=nlin&arxiv_sel=nucl-ex&arxiv_sel=nucl-th&arxiv_sel=physics&arxiv_sel=quant-ph&arxiv_sel=q-bio&aut_xct=YES&aut_logic=OR&author="
    45 adslink2="+&ned_query=YES&sim_query=YES&start_mon=&start_year=&end_mon=&end_year=&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=999&start_nr=1&jou_pick=NO&ref_stems="
    46 adslink3="&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=SCORE&data_type=BIBTEXPLUS&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1"
    47 # 2. author list
    48 st=adslink1 ; st2 = ""
    49 tf = open("lmdall.testauthor", 'w') # this is just for testing ADS
    50 for iii in range(ntot):
    51   st = st + nom[iii].split()[0].replace('é',"%C3%A9")\
    52           +"++%2C++"\
    53           + prenom[iii].split()[0].replace('é',"%C3%A9")\
    54           +"++%3B++"\
    55           + nom[iii].split()[0].replace('é',"%C3%A9")\
    56           +"++%2C++"\
    57           + initiales[iii].split()[0].replace('é',"%C3%A9")\
    58           +"++%3B++"
    59   st2 = st2 + nom[iii] + " , " + prenom[iii] + " ; " + nom[iii] + " , " + initiales[iii] + " ; "
    60   if altnom[iii].split()[0] != "-":
    61     st = st + altnom[iii].split()[0].replace('é',"%C3%A9")\
     33### LOOP on EACH TEAM (and add a combined list for all TEAMS)
     34ll = list(set(tequipe)) ; ll.append('all') ; ll = ll[::-1]
     35for eqeq in ll:
     36
     37  ### GET ONLY MEMBERS OF THE TEAM
     38  if eqeq != 'all':
     39    w = np.where(tequipe==eqeq)
     40    nom = tnom[w] ; prenom = tprenom[w] ; initiales = tinitiales[w] ; equipe = tequipe[w]
     41    anneedeb = tanneedeb[w] ; anneefin = tanneefin[w] ; altnom = taltnom[w]
     42  else:
     43    nom = tnom ; prenom = tprenom ; initiales = tinitiales ; equipe = tequipe
     44    anneedeb = tanneedeb ; anneefin = tanneefin ; altnom = taltnom
     45  ntot = nom.size
     46 
     47  ### PREPARE ADS LINK
     48  # 1. generic parts
     49  adslink1="http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&db_key=PHY&db_key=PRE&qform=PHY&arxiv_sel=astro-ph&arxiv_sel=cond-mat&arxiv_sel=cs&arxiv_sel=gr-qc&arxiv_sel=hep-ex&arxiv_sel=hep-lat&arxiv_sel=hep-ph&arxiv_sel=hep-th&arxiv_sel=math&arxiv_sel=math-ph&arxiv_sel=nlin&arxiv_sel=nucl-ex&arxiv_sel=nucl-th&arxiv_sel=physics&arxiv_sel=quant-ph&arxiv_sel=q-bio&aut_xct=YES&aut_logic=OR&author="
     50  adslink2="+&ned_query=YES&sim_query=YES&start_mon=&start_year=&end_mon=&end_year=&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=1999&start_nr=1&jou_pick=NO&ref_stems="
     51  if oneyear is not None:
     52    adslink2="+&ned_query=YES&sim_query=YES&start_mon=&start_year="+str(oneyear)+"&end_mon=&end_year="+str(oneyear)+"&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=1999&start_nr=1&jou_pick=NO&ref_stems="
     53  adslink3="&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=SCORE&data_type=BIBTEXPLUS&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1"
     54  # 2. author list
     55  st=adslink1 ; st2 = ""
     56  tf = open("ads.testauthor", 'w') # this is just for testing ADS outside the script
     57  for iii in range(ntot):
     58    st = st + nom[iii].split()[0].replace('é',"%C3%A9")\
    6259            +"++%2C++"\
    6360            + prenom[iii].split()[0].replace('é',"%C3%A9")\
    6461            +"++%3B++"\
    65             + altnom[iii].split()[0].replace('é',"%C3%A9")\
     62            + nom[iii].split()[0].replace('é',"%C3%A9")\
    6663            +"++%2C++"\
    6764            + initiales[iii].split()[0].replace('é',"%C3%A9")\
    6865            +"++%3B++"
    69     st2 = st2 + altnom[iii] + " , " + prenom[iii] + " ; " + altnom[iii] + " , " + initiales[iii] + " ; "   
    70 st=st+adslink2
    71 tf.write(st2)
    72 tf.close()
    73 # 3. journal list
    74 jn = ""
    75 f = open("listjournals.txt", 'r')
    76 for line in f:
    77   jj = line.strip().replace("&","%26")
    78   jn = jn + jj + "+"
    79 st=st+jn+adslink3
    80 # 4. write final result
    81 dalink = "lmdall.link"
    82 os.system('rm -rf '+dalink)
    83 daf = open(dalink, 'w')
    84 daf.write(st)
    85 daf.close()
     66    st2 = st2 + nom[iii] + " , " + prenom[iii] + " ; " + nom[iii] + " , " + initiales[iii] + " ; "
     67    if altnom[iii].split()[0] != "-":
     68      st = st + altnom[iii].split()[0].replace('é',"%C3%A9")\
     69              +"++%2C++"\
     70              + prenom[iii].split()[0].replace('é',"%C3%A9")\
     71              +"++%3B++"\
     72              + altnom[iii].split()[0].replace('é',"%C3%A9")\
     73              +"++%2C++"\
     74              + initiales[iii].split()[0].replace('é',"%C3%A9")\
     75              +"++%3B++"
     76      st2 = st2 + altnom[iii] + " , " + prenom[iii] + " ; " + altnom[iii] + " , " + initiales[iii] + " ; "   
     77  st=st+adslink2
     78  tf.write(st2)
     79  tf.close()
     80  # 3. journal list
     81  jn = ""
     82  f = open("listjournals.txt", 'r')
     83  for line in f:
     84    jj = line.strip().replace("&","%26")
     85    jn = jn + jj + "+"
     86  st=st+jn+adslink3
     87  # 4. write final result
     88  dalink = folder+eqeq.strip()+".link"
     89  os.system('rm -rf '+dalink)
     90  daf = open(dalink, 'w')
     91  daf.write(st)
     92  daf.close()
     93 
     94  ### RETRIEVE COMPLETE BIBTEX FILE
     95  ads.makepage('lmd_dummy',retrieve=True,linkads=dalink,customcond=usercond,verbose=False)
     96 
     97  ### LOOP ON NAMES
     98  miny = 9999 ; maxy = -9999 ; lk = "<br>Author:"
     99  for iii in range(ntot):
     100    # 1. get and prepare various components
     101    danom = nom[iii].strip() ; daprenom = prenom[iii].strip()
     102    dayears = int(anneedeb[iii]) ; dayeare = int(anneefin[iii])
     103    daini = initiales[iii].split()[0]
     104    if usercond is None: cc = ''' -c ' '''
     105    else: cc = usercond + ''' -c ' '''
     106    cc = cc + ''' author:"'''+danom+'''" '''
     107    if altnom[iii].split()[0] != "-":
     108       danomalt = altnom[iii].split()[0]
     109       cc = cc + ''' or author:"'''+danomalt+'''" '''
     110    cc = cc+''' ' '''
     111    # -- if year start 0000 and year end 0000 do not do anything
     112    if dayears + dayeare != 0:
     113      if dayears == 0: dayears = anneec
     114      if dayeare == 0: dayeare = anneec
     115      # 2. info
     116      print danom+"-"+daprenom+"-"+str(dayears)+"-"+str(dayeare)
     117      # 3. make page
     118      if oneyear is None: ly = range(dayeare,dayears-1,-1)
     119      else: ly = [oneyear]
     120      ads.makepage('lmd_'+danom.replace(" ", ""),\
     121                 retrieve = False,\
     122                 customcond = cc,\
     123                 listyear = ly,\
     124                 linkads = dalink,\
     125                 title = titpre+daprenom+" "+danom+titsuf,\
     126                 printnum = True,\
     127                 verbose = False,\
     128                 target = folder)
     129      # 4. get intervals of years for the whole lab
     130      if oneyear is None:
     131        if dayears < miny: miny = dayears
     132        if dayeare > maxy: maxy = dayeare 
     133      # 5. get authors link list
     134      lk = lk + ''' <a href="lmd_'''+danom.replace(" ", "")+'''.html">'''+daini+" "+danom.replace('é',"&eacute;")+"</a> /"
     135 
     136  ### MAKE FINAL PAGE
     137  if oneyear is None: ly = range(maxy,miny-1,-1)
     138  else: ly = [oneyear]
     139  ads.makepage('lmd_'+eqeq.strip(),\
     140               retrieve = False,\
     141               listyear = ly,\
     142               linkads = dalink,\
     143               title = "<CENTER><H2><EM><font color='#B8860B;'>Peer-reviewed publications for team "+eqeq.strip()+"</font></EM></H2></CENTER>",\
     144               addlink = lk,\
     145               customcond = usercond,\
     146               printnum = True,\
     147               target = folder)
    86148
    87 ### RETRIEVE COMPLETE BIBTEX FILE
    88 ads.makepage('lmd_dummy',retrieve=True,linkads=dalink,listyear=[1950])
     149### CLEAN
     150os.system('rm -rf *dummy*')
     151os.system('rm -rf '+folder+'*.link*')
    89152
    90 ### LOOP ON NAMES
    91 miny = 9999 ; maxy = -9999 ; lk = "<br>Author:"
    92 for iii in range(ntot):
    93   # 1. get and prepare various components
    94   danom = nom[iii].split()[0] ; daprenom = prenom[iii].split()[0]
    95   dayears = int(anneedeb[iii]) ; dayeare = int(anneefin[iii])
    96   daini = initiales[iii].split()[0]
    97   cc = ''' -c ' '''
    98   cc = cc + ''' author:"'''+danom+'''" '''
    99   if altnom[iii].split()[0] != "-":
    100      danomalt = altnom[iii].split()[0]
    101      cc = cc + ''' or author:"'''+danomalt+'''" '''
    102   cc = cc+''' ' '''
    103   # -- if year start 0000 and year end 0000 do not do anything
    104   if dayears + dayeare != 0:
    105     if dayears == 0: dayears = anneec
    106     if dayeare == 0: dayeare = anneec
    107     # 2. info
    108     print danom+"-"+daprenom+"-"+str(dayears)+"-"+str(dayeare)
    109     # 3. make page
    110     ads.makepage('lmd_'+danom,\
    111                retrieve=False,\
    112                customcond=cc,\
    113                listyear=range(dayeare,dayears-1,-1),\
    114                linkads=dalink,\
    115                title = titpre+daprenom+" "+danom+titsuf)
    116     # 4. get intervals of years for the whole lab
    117     if dayears < miny: miny = dayears
    118     if dayeare > maxy: maxy = dayeare 
    119     # 5. get authors link list
    120     lk = lk + ''' <a href="lmd_'''+danom+'''.html">'''+daini+" "+danom.replace('é',"&eacute;")+"</a> /"
    121 
    122 ### MAKE FINAL PAGE
    123 ads.makepage('lmd_',\
    124              retrieve = False,\
    125              listyear = range(maxy,miny-1,-1),\
    126              linkads=dalink,\
    127              title = "<CENTER><H2><EM><font color='#B8860B;'>Peer-reviewed publications for LMD</font></EM></H2></CENTER>",\
    128              addlink = lk,\
    129              target = "lmdall")
  • trunk/UTIL/PYTHON/bibweb/planetowebsite/lmdplaneto.link

    r1143 r1179  
    1 http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&db_key=PHY&qform=AST&arxiv_sel=astro-ph&arxiv_sel=cond-mat&arxiv_sel=cs&arxiv_sel=gr-qc&arxiv_sel=hep-ex&arxiv_sel=hep-lat&arxiv_sel=hep-ph&arxiv_sel=hep-th&arxiv_sel=math&arxiv_sel=math-ph&arxiv_sel=nlin&arxiv_sel=nucl-ex&arxiv_sel=nucl-th&arxiv_sel=physics&arxiv_sel=quant-ph&arxiv_sel=q-bio&aut_logic=OR&obj_logic=OR&author=Spiga%2C+A%0D%0AForget%2C+F%0D%0ALebonnois%2C+S%0D%0AMillour%2C+E&object=&start_mon=&start_year=1990&end_mon=&end_year=&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=200&start_nr=1&jou_pick=NO&ref_stems=&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=NDATE&data_type=BIBTEXPLUS&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1
     1http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&db_key=PHY&qform=AST&arxiv_sel=astro-ph&arxiv_sel=cond-mat&arxiv_sel=cs&arxiv_sel=gr-qc&arxiv_sel=hep-ex&arxiv_sel=hep-lat&arxiv_sel=hep-ph&arxiv_sel=hep-th&arxiv_sel=math&arxiv_sel=math-ph&arxiv_sel=nlin&arxiv_sel=nucl-ex&arxiv_sel=nucl-th&arxiv_sel=physics&arxiv_sel=quant-ph&arxiv_sel=q-bio&aut_logic=OR&obj_logic=OR&author=Spiga%2C+A%0D%0AForget%2C+F%0D%0ALebonnois%2C+S%0D%0AMillour%2C+E&object=&start_mon=&start_year=1990&end_mon=&end_year=&ttl_logic=OR&title=&txt_logic=OR&text=&nr_to_return=999&start_nr=1&jou_pick=NO&ref_stems=&data_and=ALL&group_and=ALL&start_entry_day=&start_entry_mon=&start_entry_year=&end_entry_day=&end_entry_mon=&end_entry_year=&min_score=&sort=NDATE&data_type=BIBTEXPLUS&aut_syn=YES&ttl_syn=YES&txt_syn=YES&aut_wt=1.0&obj_wt=1.0&ttl_wt=0.3&txt_wt=3.0&aut_wgt=YES&obj_wgt=YES&ttl_wgt=YES&txt_wgt=YES&ttl_sco=YES&txt_sco=YES&version=1
  • trunk/UTIL/PYTHON/bibweb/planetowebsite/lmdplaneto.py

    r1143 r1179  
    44#######
    55lk = "lmdplaneto.link"
     6anneec = 2014
     7gencond = ''' -c 'not journal:"Discussions"' ''' # to solve EGU journal duplication
    68#######
    79
    810ads.makepage('pubmars',\
    911             retrieve = True,\
    10              customcond = ''' -c 'title:"Mars" or title:"martian"' ''',\
     12             customcond = gencond + ''' -c 'title:"Mars" or title:"martian"' ''',\
    1113             linkads = lk,\
     14             printnum = True,\
    1215             title = "<CENTER><H2><EM><font color='#B8860B;'>Mars peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>")
    1316
    1417ads.makepage('pubtitan',\
    1518             retrieve = False,\
    16              customcond = ''' -c 'title:"Titan"' ''',\
     19             customcond = gencond + ''' -c 'title:"Titan"' ''',\
    1720             linkads = lk,\
     21             printnum = True,\
    1822             title = "<CENTER><H2><EM><font color='#B8860B;'>Titan peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>")
    1923
    2024ads.makepage('pubvenus',\
    2125             retrieve = False,\
    22              customcond = ''' -c 'title:"Venus" or title:"venusian"' ''',\
     26             customcond = gencond + ''' -c 'title:"Venus" or title:"venusian"' ''',\
    2327             linkads = lk,\
     28             printnum = True,\
    2429             title = "<CENTER><H2><EM><font color='#B8860B;'>Venus peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>")
    2530
    2631ads.makepage('pubexo',\
    2732             retrieve = False,\
    28              customcond = ''' -c 'abstract:"exoplanet" or title:"habitable" or title:"habitability"' ''',\
     33             customcond = gencond + ''' -c 'abstract:"exoplanet" or title:"habitable" or title:"habitability"' ''',\
    2934             linkads = lk,\
     35             printnum = True,\
    3036             title = "<CENTER><H2><EM><font color='#B8860B;'>Exoplanets peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>")
    3137
    3238ads.makepage('pubforget',\
    3339             retrieve = False,\
    34              customcond = ''' -c 'author:"Forget"' ''',\
    35              listyear = range(2014,1992,-1),\
     40             customcond = gencond + ''' -c 'author:"Forget"' ''',\
     41             listyear = range(anneec,1993-1,-1),\
    3642             linkads = lk,\
     43             printnum = True,\
    3744             title = "<CENTER><H2><EM><font color='#B8860B;'>Francois Forget's peer-reviewed publications</font></EM></H2></CENTER>")
    3845
    3946ads.makepage('publebonnois',\
    4047             retrieve = False,\
    41              customcond = ''' -c 'author:"Lebonnois"' ''',\
    42              listyear = range(2014,1998,-1),\
     48             customcond = gencond + ''' -c 'author:"Lebonnois"' ''',\
     49             listyear = range(anneec,1999-1,-1),\
    4350             linkads = lk,\
     51             printnum = True,\
    4452             title = "<CENTER><H2><EM><font color='#B8860B;'>Sebastien Lebonnois's peer-reviewed publications</font></EM></H2></CENTER>")
    4553
    4654ads.makepage('pubspiga',\
    4755             retrieve = False,\
    48              customcond = ''' -c 'author:"Spiga"' ''',\
    49              listyear = range(2014,2006,-1),\
     56             customcond = gencond + ''' -c 'author:"Spiga"' ''',\
     57             listyear = range(anneec,2007-1,-1),\
    5058             linkads = lk,\
     59             printnum = True,\
    5160             title = "<CENTER><H2><EM><font color='#B8860B;'>Aymeric Spiga's peer-reviewed publications</font></EM></H2></CENTER>")
    5261
    5362ads.makepage('pubmillour',\
    5463             retrieve = False,\
    55              customcond = ''' -c 'author:"Millour"' ''',\
    56              listyear = range(2014,2007,-1),\
     64             customcond = gencond + ''' -c 'author:"Millour"' ''',\
     65             listyear = range(anneec,2008-1,-1),\
    5766             linkads = lk,\
     67             printnum = True,\
    5868             title = "<CENTER><H2><EM><font color='#B8860B;'>Ehouarn Millour's peer-reviewed publications</font></EM></H2></CENTER>")
    5969
    6070ads.makepage('pub',\
    6171             retrieve = False,\
    62              listyear = range(2014,1992,-1),\
     72             listyear = range(anneec,1993-1,-1),\
    6373             linkads = lk,\
     74             customcond = gencond,\
     75             printnum = True,\
    6476             title = "<CENTER><H2><EM><font color='#B8860B;'>Peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>",\
    6577addlink = '''
     
    7486<a href="pubforget.html">F. Forget</a> /
    7587<a href="publebonnois.html">S. Lebonnois</a> /
     88<a href="pubmillour.html">E. Millour</a> /
    7689<a href="pubspiga.html">A. Spiga</a> /
    77 <a href="pubmillour.html">E. Millour</a><br>
    7890<br>
    7991<hr>
    8092''',\
    81              target="lmdplaneto")
     93target="/home/marshttp/www-mars/pubplaneto")
Note: See TracChangeset for help on using the changeset viewer.