Skip to content

Commit

Permalink
Update broken_link_checker.py
Browse files Browse the repository at this point in the history
Test update for broken_link_checker. The broken link checker works but does not creates an issue yet. This issue is currently being tackled.
  • Loading branch information
thierrylahaije authored Aug 23, 2024
1 parent a6d7f13 commit 59c2095
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions broken_link_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def identifyBrokenLinks(uniqueExternalLinks):
count = 0
length_uniqueExternalLinks = len(uniqueExternalLinks)

for link in uniqueExternalLinks:
for link in uniqueExternalLinks[:200]:

count = count + 1

Expand Down Expand Up @@ -223,7 +223,6 @@ def matchBrokenLinks(brokenLinksList,externalLinksListRaw):
EndDataFrame = dataframeFinal.merge(dataframeFinal2, left_on='Broken_Link_URL', right_on ='link', how='outer')
del EndDataFrame['link']


def push_issue_git():

#set dt_string with current date/time
Expand Down Expand Up @@ -255,14 +254,18 @@ def push_issue_git():
issuebody = 'Today, a total of ' + str(len(df3.index)) + ' link errors have been found. The following links have been found containing errors:' + '\n' + tablecomp

#defining data to push to git issue
data = {"title": titleissue, "body": issuebody, "assignee": "thierrylahaije"}
data = {"title": titleissue, "body": issuebody}

#Post issue message using requests and json
requests.post(url,data=json.dumps(data),headers=headers)

print('Process succeeded')
response = requests.post(url, data=json.dumps(data), headers=headers)
if response.status_code == 201:
print('Issue created successfully')
else:
print(f'Failed to create issue: {response.status_code} - {response.text}')


else:
print('No broken links found')
pass

# # Execute Functions
Expand Down

0 comments on commit 59c2095

Please sign in to comment.