# XList # An automated HTML arXiv publication list generator # by Peter Rohde # University of Queensland, Australia # e-mail: rohde@physics.uq.edu.au # INSTRUCTIONS # Before using the program, two files must be created in the same directory. # Create a file named 'proxy_settings.txt'. This file contains a single line with your proxy server settings. The string is of the form 'http://username:password@proxy.wherever.com:port'. # Create a file named 'author_list.txt'. This file contains the list of authors which should be included in the publication list. Each line of the file contains a single author name. The author name should be the arXiv author name. # Now you're ready to run the program. Simply type 'python XList.py' from the command line. # DISCLAIMER # This software may be freely used, modified and distributed, provided that the original author is acknowledged. import urllib2 import re import string ack_str = 'This publication list was created automatically by Peter Rohde\'s XList.' search_string = '' author_count = 0 author_file = open('author_list.txt') for line in author_file.readlines(): if author_count == 0: search_string += '+' + string.split(line, '\n')[0] else: search_string = '+OR' + search_string + '+' + string.split(line, '\n')[0] author_count += 1 arxiv_address = 'http://arxiv.org/find/quant-ph/1/au:' + search_string + '/0/1/0/all/0/1?per_page=1000' proxy_file = open('proxy_settings.txt') proxy_str = proxy_file.readlines()[0] proxy_file.close() proxies = proxies={'http': proxy_str} proxy_support = urllib2.ProxyHandler(proxies) opener = urllib2.build_opener(proxy_support) urllib2.install_opener(opener) input_file = urllib2.urlopen(arxiv_address) no_mode = 0 author_mode = 1 journal_ref_mode = 2 title_mode = 3 output_file = open('publication_list.html','w') mode = no_mode author_list = '' journal_ref = '' arxiv_ref = '' arxiv_year = '' bf_sub = re.compile('{\\\\bf ( [^}]* ) }', re.VERBOSE) em_sub = re.compile('{\\\\em ( [^}]* ) }', re.VERBOSE) for line in input_file.readlines(): if re.search('', line): output_file.write(entry_href) output_file.write(entry_title + ', ') output_file.write(author_list) if journal_ref != '': output_file.write(', ' + journal_ref) else: arxiv_year = string.split(arxiv_ref,'/')[1][0:2] if arxiv_year[0] == '0': output_file.write(', ' + arxiv_ref + ' (20' + arxiv_year + ')') else: output_file.write(', ' + arxiv_ref + ' (19' + arxiv_year + ')') output_file.write('
\n') mode = no_mode author_list = '' journal_ref = '' arxiv_ref = '' arxiv_year_str = '' if re.search('' if mode == title_mode: entry_title += string.split(line, '<')[0] if re.search('Title:', line): entry_title = string.split(string.split(line, '>')[2], '<')[0] if re.search('