Changeset 1179 for trunk/UTIL
- Timestamp:
- Feb 17, 2014, 6:19:02 PM (11 years ago)
- 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 -*- 1 2 import os, re, urllib 2 3 3 4 ## ----------------------------------------------------------------- 4 5 ## 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 6 7 ## ----------------------------------------------------------------- 7 8 ## NB: uses BIBTEX2HTML https://www.lri.fr/~filliatr/bibtex2html/doc/manual.html 8 9 ## ... and of course NASA ADS http://adsabs.harvard.edu/ 9 10 ## ----------------------------------------------------------------- 11 12 def printpubli(num): 13 if num == 1: char = "%.0f publication" % (num) 14 else: char = "%.0f publications" % (num) 15 return char 10 16 11 17 def makepage(authorref, … … 19 25 addpdf = None, 20 26 addlink = None, 21 target=None): 22 27 printnum = False, 28 verbose = True, 29 target = None): 30 31 htmlcontent1 = "" 32 htmlcontent2 = "" 23 33 htmlcontent = "" 24 34 … … 26 36 if embedded: 27 37 htmlfile = open('header.html','r') 28 htmlcontent = htmlfile.read()38 htmlcontent1 = htmlfile.read() 29 39 htmlfile.close() 30 40 #else: 31 41 if title is None: 32 htmlcontent = htmlcontent+ "<h2>"+authorref+"'s publications</h2>"42 htmlcontent1 = htmlcontent1 + "<h2>"+authorref+"'s publications</h2>" 33 43 elif title == "": 34 44 pass 35 45 else: 36 htmlcontent = htmlcontent+ title46 htmlcontent1 = htmlcontent1 + title 37 47 38 48 ### if linkads is None, we set it to "link.authorref" … … 42 52 ### GET INFO FROM ADS 43 53 if retrieve: 44 print "retrieving info from ADS"54 if verbose: print "retrieving info from ADS" 45 55 linkfile = open(linkads,'r') 46 56 url = linkfile.read() 47 57 linkfile.close() 48 58 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 ## 49 65 bibfile = open(linkads+'.bib','w') 50 66 print >> bibfile,html 51 67 bibfile.close() 52 68 53 69 ### if only one year and no customcond, make it useful. ask for years >= this value 54 70 if len(listyear) == 1 and customcond is None: … … 56 72 listyear[0] = 99 57 73 58 ### ADD LINK WITH YEARS IN HEADER59 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>"+addlink64 65 74 ### YEAR LOOP 75 numpublitot = 0 ; nonzeroyears = [] 66 76 for year in listyear: 67 77 68 78 author = authorref+str(year) 69 print author70 79 71 80 # 0. define condition … … 84 93 author+'.bib',\ 85 94 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) 87 96 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) 88 105 89 106 # modify the bib file to insert pdf links … … 111 128 header = '<a name="%.0f"></a>' % (year) 112 129 header += "<h3>%.0f <a href=''>.</a> </h3>" % (year) 130 if printnum: header += "("+printpubli(numpubli)+")" 113 131 if embedded: header += '<br>' 114 132 else: 115 133 header = '' 134 if printnum: header += "("+printpubli(numpubli)+")" 116 135 117 136 header = '"'+header+'"' … … 129 148 -nofooter --nodoc \ 130 149 --header %s -nokeywords \ 131 %s " % (arg)150 %s >> /dev/null 2>> /dev/null" % (arg) 132 151 os.system(cmd) 133 152 … … 166 185 htmlcontent += htmlfile.read() 167 186 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 169 202 htmlmain = open(authorref+'.html','w') 170 203 print >> htmlmain, htmlcontent … … 176 209 arg = target,\ 177 210 authorref+"*.html",\ 211 target,\ 178 212 authorref+"*.bib",\ 179 213 authorref+"*.txt",\ 180 target,\181 214 target+linkads+".bib",\ 182 215 "*.css",\ 183 216 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 1 1 A&A 2 2 ACP 3 ACPD4 3 AdSpR 4 AMT 5 5 AnGeo 6 6 AnGla 7 7 ApOpt 8 ApJ 8 9 AtmEn 9 10 AtmRe … … 11 12 BAAS 12 13 BAMS 14 BGeo 13 15 BoLMe 14 16 Chaos 15 17 ClDy 18 CliPa 16 19 CRASB 17 20 CRASE … … 21 24 E&ES 22 25 E&PSL 26 EMS 23 27 ERL 24 28 FizAO 29 GeCAS 25 30 GeoRL 26 31 GApFD 27 GID28 32 GI 29 33 GMS 34 GMD 30 35 QJRMS 31 36 Icar 37 IJAsB 32 38 IJCli 33 39 IJMSE 40 IJRS 34 41 InPhT 42 ITGRS 35 43 IzAOP 36 44 JAMES 37 45 JApMC 46 JApMe 38 47 JAtOT 39 48 JAtS … … 43 52 JGRD 44 53 JGRE 54 JGRG 55 JMoSp 56 JMR 45 57 JMTAS 46 58 JPO 59 JQRST 47 60 LNP 48 61 MAP 49 62 MWRv 63 NatCC 64 NatCo 50 65 NatGe 51 66 Natur 52 67 NCimC 53 68 NHESS 69 Nonli 54 70 NPGeo 55 71 OcDyn … … 57 73 OptEn 58 74 P&SS 75 PCEB 59 76 PhFl 60 77 PhLA 61 78 PhRvL 79 PhT 62 80 PhyD 81 PNAS 63 82 QJRMS 83 QSRv 84 RCD 85 REC 64 86 RSPTA 65 87 RvGeo 66 88 Sci 89 TCry 90 Tell 67 91 TellA 92 TellB 93 WIRCC 94 WRR 95 WtFor -
trunk/UTIL/PYTHON/bibweb/biglmdwebsite/listpeople.txt
r1143 r1179 1 ----------- -----------------------------------------------------------------------------------------1 -----------http://lite3.framapad.org/p/YTTXcVSXCL--------------------------------------------------- 2 2 NOM ; PRENOM ; INITIALES ; EQUIPE ; ANNEE DEBUT ; ANNEE FIN (0000 si présent) ; NOM 2 ('-' si aucun) 3 3 ---------------------------------------------------------------------------------------------------- 4 Armante ; Raymond ; R. ; ABCT ; 1995 ; 0000 ; - 5 Arsouze ; Thomas ; T. ; INTRO ; 2013 ; 0000 ; - 6 Basdevant ; Claude ; C. ; DPAO ; 1971 ; 0000 ; - 7 Bonazzola ; Marine ; M. ; EMC3 ; 1999 ; 0000 ; - 4 8 Bony ; Sandrine ; S. ; EMC3 ; 1990 ; 0000 ; - 9 Boucher ; Olivier ; O. ; EMC3 ; 1995 ; 0000 ; - 10 Capelle ; Virginie ; V. ; ABCT ; 2008 ; 0000 ; - 11 Chedin ; Alain ; A. ; ABCT ; 1971 ; 0000 ; Chédin 12 Chepfer ; Helene ; H. ; INTRO ; 1998 ; 0000 ; - 13 Cheruy ; Frédérique ; F. ; EMC3 ; 1988 ; 0000 ; - 14 Claud ; Chantal ; C. ; DPAO ; 1992 ; 0000 ; - 15 Codron ; Francis ; F. ; EMC3 ; 2000 ; 0000 ; - 5 16 Drobinski ; Philippe ; P. ; INTRO ; 2003 ; 0000 ; - 17 Dubos ; Thomas ; T. ; INTRO ; 2007 ; 0000 ; - 18 Dufresne ; Jean-Louis ; J.-L. ; EMC3 ; 1985 ; 0000 ; - 19 Duvel ; Jean-Philippe ; J.-P. ; DPAO ; 1990 ; 0000 ; - 6 20 Crevoisier ; Cyril ; C. ; ABCT ; 2002 ; 0000 ; - 7 Flamant ; Pierre ; P. ; ABCT ; 1976 ; 0000 ; - 21 Edouard ; Dimitri ; D. ; ABCT ; 2002 ; 0000 ; - 22 Farge ; Marie ; F. ; DPAO ; 1990 ; 0000 ; - 23 Flamant ; Pierre ; P. ; ABCT ; 1964 ; 0000 ; - 8 24 Forget ; 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 ; - 25 Gay-Balmaz ; François ; F. ; DPAO ; 2011 ; 0000 ; - 26 Gibert ; Fabien ; F. ; ABCT ; 2003 ; 0000 ; - 27 Goulas ; Yves ; Y. ; ABCT ; 1990 ; 0000 ; - 28 Grandpeix ; Jean-Yves ; J.-Y. ; EMC3 ; 1990 ; 0000 ; - 29 Hertzog ; Albert ; A. ; DPAO ; 1999 ; 0000 ; - 30 Hourdin ; Frédéric ; F. ; EMC3 ; 1992 ; 0000 ; - 31 Jacquinet-Husson ; Nicole ; N. ; ABCT ; 1971 ; 0000 ; - 32 Lapeyre ; Guillaume ; G. ; DPAO ; 2004 ; 0000 ; - 33 Laval ; Katia ; K. ; EMC3 ; 1970 ; 0000 ; - 34 Lebonnois ; Sébastien ; S. ; PLANETO ; 1999 ; 0000 ; - 35 Legras ; Bernard ; B. ; DPAO ; 1984 ; 0000 ; - 36 Le Mounier ; Florian ; F. ; ABCT ; 2011 ; 0000 ; - 37 Li ; Zhao-Xin ; Z.-X. ; EMC3 ; 1988 ; 0000 ; - 38 Lott ; François ; F. ; DPAO ; 1995 ; 0000 ; - 13 39 Madeleine ; Jean-Baptiste ; J.-B. ; EMC3 ; 2009 ; 0000 ; - 40 Mailler ; Sylvain ; S. ; INTRO ; 2009 ; 0000 ; - 14 41 Menut ; Laurent ; L. ; INTRO ; 1999 ; 0000 ; - 42 Moya ; Ismael ; I. ; ABCT ; 1973 ; 0000 ; - 43 Ounis ; Abderrahmane ; A. ; ABCT ; 2001 ; 0000 ; - 44 Noel ; Vincent ; V. ; INTRO ; 1999 ; 0000 ; - 45 Picon ; Laurence ; L. ; EMC3 ; 1985 ; 0000 ; - 46 Plougonven ; Riwal ; R. ; DPAO ; 2005 ; 0000 ; - 47 Polcher ; Jan ; J. ; INTRO ; 2013 ; 0000 ; - 15 48 Rio ; Catherine ; C. ; EMC3 ; 2000 ; 0000 ; - 16 49 Risi ; Camille ; C. ; EMC3 ; 2006 ; 0000 ; - 50 Riviere ; Gwendal ; G. ; DPAO ; 2014 ; 0000 ; Rivière 17 51 Sadourny ; Robert ; R. ; LEGACY ; 1968 ; 2002 ; - 18 Scott ; Noëlle ; N. ; ABCT ; 1981 ; 0000 ; - 52 Scott ; Noëlle ; N.A. ; ABCT ; 1971 ; 0000 ; - 53 Seze ; Geneviève ; G. ; EMC3 ; 1987 ; 0000 ; Sèze 54 Speich ; Sabrina ; S. ; DPAO ; 2014 ; 0000 ; - 19 55 Spiga ; Aymeric ; A. ; PLANETO ; 2007 ; 0000 ; - 20 Stubenrauch ; Claudia ; C. ; ABCT ; 1994 ; 0000 ; - 56 Stegner ; Alexandre ; A. ; DPAO ; 2001 ; 0000 ; - 57 Stubenrauch ; Claudia ; C.J. ; ABCT ; 1996 ; 0000 ; - 58 Talagrand ; Olivier ; O. ; DPAO ; 1970 ; 0000 ; - 59 Teitelbaum ; Hector ; H. ; DPAO ; 1970 ; 0000 ; - 60 Turquety ; Solene ; S. ; INTRO ; 2008 ; 0000 ; - 61 Valari ; Myrto ; M. ; INTRO ; 2008 ; 0000 ; - 62 Vial ; François ; F. ; DPAO ; 1987 ; 0000 ; - 21 63 Zeitlin ; Vladimir ; V. ; DPAO ; 1991 ; 0000 ; Tseitlin -
trunk/UTIL/PYTHON/bibweb/biglmdwebsite/lmdall.py
r1144 r1179 8 8 # Aymeric SPIGA 9 9 # Laboratoire de Météorologie Dynamique 10 # 15-20/12/2013 10 # 15-20/12/2013. teams 01/2014. 11 11 ########################################## 12 12 … … 15 15 titsuf = "</font></EM></H2></CENTER>" # title suffix 16 16 anneec = 2014 # last year to include 17 oneyear = None 18 #oneyear = 2013 19 usercond = None 20 usercond = ''' -c 'not journal:"Discussions"' ''' # fixes the EGU Discussions journals problem 17 21 #### 18 22 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 24 folder = "/home/marshttp/www-mars/publmdall" 25 if oneyear is not None: folder = folder + str(oneyear) 34 26 35 27 ### CLEAN 36 os.system('rm -rf lmdall')28 os.system('rm -rf '+folder) 37 29 38 30 ### 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 31 tnom,tprenom,tinitiales,tequipe,tanneedeb,tanneefin,taltnom = np.loadtxt("listpeople.txt",delimiter=";",dtype='string',unpack=True,skiprows=3,comments="#") 41 32 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) 34 ll = list(set(tequipe)) ; ll.append('all') ; ll = ll[::-1] 35 for 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")\ 62 59 +"++%2C++"\ 63 60 + prenom[iii].split()[0].replace('é',"%C3%A9")\ 64 61 +"++%3B++"\ 65 + altnom[iii].split()[0].replace('é',"%C3%A9")\62 + nom[iii].split()[0].replace('é',"%C3%A9")\ 66 63 +"++%2C++"\ 67 64 + initiales[iii].split()[0].replace('é',"%C3%A9")\ 68 65 +"++%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('é',"é")+"</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) 86 148 87 ### RETRIEVE COMPLETE BIBTEX FILE 88 ads.makepage('lmd_dummy',retrieve=True,linkads=dalink,listyear=[1950]) 149 ### CLEAN 150 os.system('rm -rf *dummy*') 151 os.system('rm -rf '+folder+'*.link*') 89 152 90 ### LOOP ON NAMES91 miny = 9999 ; maxy = -9999 ; lk = "<br>Author:"92 for iii in range(ntot):93 # 1. get and prepare various components94 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 anything104 if dayears + dayeare != 0:105 if dayears == 0: dayears = anneec106 if dayeare == 0: dayeare = anneec107 # 2. info108 print danom+"-"+daprenom+"-"+str(dayears)+"-"+str(dayeare)109 # 3. make page110 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 lab117 if dayears < miny: miny = dayears118 if dayeare > maxy: maxy = dayeare119 # 5. get authors link list120 lk = lk + ''' <a href="lmd_'''+danom+'''.html">'''+daini+" "+danom.replace('é',"é")+"</a> /"121 122 ### MAKE FINAL PAGE123 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=11 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=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 4 4 ####### 5 5 lk = "lmdplaneto.link" 6 anneec = 2014 7 gencond = ''' -c 'not journal:"Discussions"' ''' # to solve EGU journal duplication 6 8 ####### 7 9 8 10 ads.makepage('pubmars',\ 9 11 retrieve = True,\ 10 customcond = ''' -c 'title:"Mars" or title:"martian"' ''',\12 customcond = gencond + ''' -c 'title:"Mars" or title:"martian"' ''',\ 11 13 linkads = lk,\ 14 printnum = True,\ 12 15 title = "<CENTER><H2><EM><font color='#B8860B;'>Mars peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>") 13 16 14 17 ads.makepage('pubtitan',\ 15 18 retrieve = False,\ 16 customcond = ''' -c 'title:"Titan"' ''',\19 customcond = gencond + ''' -c 'title:"Titan"' ''',\ 17 20 linkads = lk,\ 21 printnum = True,\ 18 22 title = "<CENTER><H2><EM><font color='#B8860B;'>Titan peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>") 19 23 20 24 ads.makepage('pubvenus',\ 21 25 retrieve = False,\ 22 customcond = ''' -c 'title:"Venus" or title:"venusian"' ''',\26 customcond = gencond + ''' -c 'title:"Venus" or title:"venusian"' ''',\ 23 27 linkads = lk,\ 28 printnum = True,\ 24 29 title = "<CENTER><H2><EM><font color='#B8860B;'>Venus peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>") 25 30 26 31 ads.makepage('pubexo',\ 27 32 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"' ''',\ 29 34 linkads = lk,\ 35 printnum = True,\ 30 36 title = "<CENTER><H2><EM><font color='#B8860B;'>Exoplanets peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>") 31 37 32 38 ads.makepage('pubforget',\ 33 39 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),\ 36 42 linkads = lk,\ 43 printnum = True,\ 37 44 title = "<CENTER><H2><EM><font color='#B8860B;'>Francois Forget's peer-reviewed publications</font></EM></H2></CENTER>") 38 45 39 46 ads.makepage('publebonnois',\ 40 47 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),\ 43 50 linkads = lk,\ 51 printnum = True,\ 44 52 title = "<CENTER><H2><EM><font color='#B8860B;'>Sebastien Lebonnois's peer-reviewed publications</font></EM></H2></CENTER>") 45 53 46 54 ads.makepage('pubspiga',\ 47 55 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),\ 50 58 linkads = lk,\ 59 printnum = True,\ 51 60 title = "<CENTER><H2><EM><font color='#B8860B;'>Aymeric Spiga's peer-reviewed publications</font></EM></H2></CENTER>") 52 61 53 62 ads.makepage('pubmillour',\ 54 63 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),\ 57 66 linkads = lk,\ 67 printnum = True,\ 58 68 title = "<CENTER><H2><EM><font color='#B8860B;'>Ehouarn Millour's peer-reviewed publications</font></EM></H2></CENTER>") 59 69 60 70 ads.makepage('pub',\ 61 71 retrieve = False,\ 62 listyear = range( 2014,1992,-1),\72 listyear = range(anneec,1993-1,-1),\ 63 73 linkads = lk,\ 74 customcond = gencond,\ 75 printnum = True,\ 64 76 title = "<CENTER><H2><EM><font color='#B8860B;'>Peer-reviewed publications of the LMD 'Planetary Atmospheres' team</font></EM></H2></CENTER>",\ 65 77 addlink = ''' … … 74 86 <a href="pubforget.html">F. Forget</a> / 75 87 <a href="publebonnois.html">S. Lebonnois</a> / 88 <a href="pubmillour.html">E. Millour</a> / 76 89 <a href="pubspiga.html">A. Spiga</a> / 77 <a href="pubmillour.html">E. Millour</a><br>78 90 <br> 79 91 <hr> 80 92 ''',\ 81 target="lmdplaneto")93 target="/home/marshttp/www-mars/pubplaneto")
Note: See TracChangeset
for help on using the changeset viewer.