]> code.communitydata.science - covid19.git/commitdiff
stop writing writing header to one-column list
authorBenjamin Mako Hill <mako@atdot.cc>
Tue, 31 Mar 2020 15:35:23 +0000 (08:35 -0700)
committerBenjamin Mako Hill <mako@atdot.cc>
Tue, 31 Mar 2020 15:35:23 +0000 (08:35 -0700)
This feels like it's asking for trouble. Description of the contents
of the list is in the filename.

wikipedia_views/scripts/fetch_daily_views.py
wikipedia_views/scripts/wikiproject_scraper.py

index 4f496fee7351963bc3d1ba5caad45da9de670c17..e3a2ff406d113754e9cd2e5d3401bb7917700c03 100755 (executable)
@@ -79,7 +79,6 @@ def main():
     t_Out = f"{outputPath}dailyviews{queryDate}.tsv"
 
     with open(articleFile, 'r') as infile:
     t_Out = f"{outputPath}dailyviews{queryDate}.tsv"
 
     with open(articleFile, 'r') as infile:
-        next(infile) #skip header
         articleList = list(infile)
 
     j = []
         articleList = list(infile)
 
     j = []
index 2ee37428c0487a10a6f9417a6d1aefa5ab671314..9d209a98b5912e6a075ca643d514b7a7aaae3609 100755 (executable)
@@ -109,7 +109,6 @@ def main():
     #3 Saves the list to a file
 
     with open(outputFile, 'w') as f:
     #3 Saves the list to a file
 
     with open(outputFile, 'w') as f:
-        f.write("Article\n")
         f.write('\n'.join(articleNames)+'\n')
     logging.debug(f"Finished scrape and made a new article file at {datetime.datetime.now()}")
 
         f.write('\n'.join(articleNames)+'\n')
     logging.debug(f"Finished scrape and made a new article file at {datetime.datetime.now()}")
 

Community Data Science Collective || Want to submit a patch?