Skip to content

Instantly share code, notes, and snippets.

@hamletbatista
Created April 30, 2020 01:26
Show Gist options
  • Save hamletbatista/157e7cad373113e9764e280f106bdac5 to your computer and use it in GitHub Desktop.
Save hamletbatista/157e7cad373113e9764e280f106bdac5 to your computer and use it in GitHub Desktop.
def get_content_gaps(content_formats):
content_gaps = dict()
SERP_features = content_formats["serp_features"]
content_gaps["url"] = content_formats["url"]
#Check if an image feature is necessary and the page doesn't have it
content_gaps["image"] = 0
if SERP_features.find("Image") >= 0:
if len(content_formats["image"]) == 0:
content_gaps["image"] += 1 # This means is an opportunity (is needed)
#Check if a video feature is necessary and the page doesn't have it
content_gaps["video"] = 0
if SERP_features.find("Video") >= 0:
if len(content_formats["video"]) == 0:
content_gaps["video"] += 1 # This means is an opportunity (is needed)
#Check if a local_business feature is necessary and the page doesn't have it
content_gaps["local_business"] = 0
if SERP_features.find("Local") >= 0:
if len(content_formats["local_business"]) == 0:
content_gaps["local_business"] += 1 # This means is an opportunity (is needed)
#Check if a review feature is necessary and the page doesn't have it
content_gaps["review"] = 0
if SERP_features.find("Reviews") >= 0:
if len(content_formats["review"]) == 0:
content_gaps["review"] += 1 # This means is an opportunity (is needed)
#Check if a top_story feature is necessary and the page doesn't have it
content_gaps["top_story"] = 0
if SERP_features.find("Stories") >= 0:
if len(content_formats["top_story"]) == 0:
content_gaps["top_story"] += 1 # This means is an opportunity (is needed)
#Check if a faq feature is necessary and the page doesn't have it
content_gaps["faq"] = 0
if SERP_features.find("FAQ") >= 0 or SERP_features.find("snippets") >= 0 or SERP_features.find("People") >= 0:
if len(content_formats["faq"]) == 0:
content_gaps["faq"] += 1 # This means is an opportunity (is needed)
#Check if a job feature is necessary and the page doesn't have it
content_gaps["job"] = 0
if SERP_features.find("Jobs") >= 0:
if len(content_formats["job"]) == 0:
content_gaps["job"] += 1 # This means is an opportunity (is needed)
return content_gaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment