Skip to content

Commit

Permalink
feat: script to fix my mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarina committed Feb 24, 2022
1 parent 19c11a4 commit 7df791a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions parse_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""
Used to parse the successfully-made PR URLs out of the log output when you
overwrote the success output file and only had the logs to go off of.
"""

import json

def main():
pr_urls = []
with open('output/output-file.txt') as f:
lines = f.readlines()
for l in lines:
if "https" in l:
pr_urls.append(l[l.index('https'):-1])

with open('output/prs-file.json', 'w') as f:
f.write(json.dumps(pr_urls))

if __name__ == "__main__":
main()

0 comments on commit 7df791a

Please sign in to comment.