2 from request_functions import *
5 This script takes in a search query and an output file. It queries the scopus API to find all papers that match the search query, and saves them to the output file.
7 Unlike some of the other scripts in this directory, it does not try to determine the state - if you restart the script, it will start over and blow away whatever you had saved before.
10 years = range(2004, 2017)
14 parser = argparse.ArgumentParser(description='Output JSON of all articles matching search query')
15 parser.add_argument('-q', help='Search query', required=True)
16 parser.add_argument('-o', help='Where to append JSON results')
17 args = parser.parse_args()
19 with open(args.o, 'w') as out_file:
21 get_search_results(args.q, out_file, year=year)
23 if __name__ == '__main__':