Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Created April 1, 2021 18:45
Show Gist options
  • Save JeremyMorgan/3781750e2cb9397df070ea74187c7819 to your computer and use it in GitHub Desktop.
Save JeremyMorgan/3781750e2cb9397df070ea74187c7819 to your computer and use it in GitHub Desktop.
Check for doubled up tags
tags = self.webpage.pagedata["tags"].split('|')
for tag in tags:
if len(tag) > 1:
#Check if this is a doubled up tag
#some look like this "IT OpsSoftware Development"
cleantag = self.checktag(tag)
if len(cleantag) > 1:
stackedTags += "- " + cleantag[0] + "\n"
stackedTags += "- " + cleantag[1] + "\n"
else :
stackedTags += "- " + cleantag[0] + "\n"
self.tempText += "tags: " + '\n' + stackedTags + "\n" if stackedTags else "tags: " + "\n"
def checktag(self,intag):
tagtemp = []
if intag == 'CloudData Professional':
tagtemp.append('Cloud')
tagtemp.append('Data Professional')
if intag == 'Data ProfessionalMachine Learning':
tagtemp.append('Data Professional')
tagtemp.append('Machine Learning')
if intag == 'Data ProfessionalNews':
tagtemp.append('Data Professional')
tagtemp.append('News')
if intag == 'Data ProfessionalTeams':
tagtemp.append('Data Professional')
tagtemp.append('Teams')
if intag == 'IT OpsSecurity Professional':
tagtemp.append('IT Ops')
tagtemp.append('Security Professional')
if intag == 'IT OpsSoftware Development':
tagtemp.append('IT Ops')
tagtemp.append('Software Development')
if intag == 'Security ProfessionalSoftware Development':
tagtemp.append('Security Professional')
tagtemp.append('Software Development')
if intag == 'CloudMachine Learning':
tagtemp.append('Cloud')
tagtemp.append('Machine Learning')
if intag == 'IT OpsCloud':
tagtemp.append('IT Ops')
tagtemp.append('Cloud')
if intag == 'IT OpsPlatform':
tagtemp.append('IT Ops')
tagtemp.append('Platform')
if intag == 'Software DevelopmentCloud':
tagtemp.append('Software Development')
tagtemp.append('Cloud')
if intag == 'NewsPlatform':
tagtemp.append('News')
tagtemp.append('Platform')
if intag == 'PlatformNews':
tagtemp.append('Platform')
tagtemp.append('News')
if intag == 'Security ProfessionalSoftware Development':
tagtemp.append('Security Professional')
tagtemp.append('Software Development')
if intag == 'Software DevelopmentData Professional':
tagtemp.append('Software Development')
tagtemp.append('Data Professional')
if intag == 'Machine LearningData Professional':
tagtemp.append('Machine Learning')
tagtemp.append('Data Professional')
if intag == 'Software DevelopmentData Professional':
tagtemp.append('Software Development')
tagtemp.append('Data Professional')
if intag == 'Software DevelopmentPlatform':
tagtemp.append('Software Development')
tagtemp.append('Platform')
if intag == 'Software DevelopmentTeams':
tagtemp.append('Software Development')
tagtemp.append('Teams')
if intag == 'CloudMachine Learning':
tagtemp.append('Cloud')
tagtemp.append('Machine Learning')
if intag == 'Security ProfessionalData Professional':
tagtemp.append('Security Professional')
tagtemp.append('Data Professional')
if intag == 'Data ProfessionalCreative':
tagtemp.append('Data Professional')
tagtemp.append('Creative')
if intag == 'Machine LearningCloud':
tagtemp.append('Machine Learning')
tagtemp.append('Cloud')
if intag == 'TeamsData Professional':
tagtemp.append('Teams')
tagtemp.append('Data Professional')
if intag == 'TeamsIT Ops':
tagtemp.append('Teams')
tagtemp.append('IT Ops')
if intag == 'TeamsPlatform':
tagtemp.append('Teams')
tagtemp.append('Platform')
if intag == 'TeamsSoftware Development':
tagtemp.append('Teams')
tagtemp.append('Software Development')
else:
tagtemp.append(intag)
return tagtemp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment