code: func (extr *ContentExtractor) GetTitle(document *goquery.Document) string {
  	title := ""
  
  	titleElement := document.Find("title")
  	if titleElement != nil && titleElement.Size() > 0 {
  		title = titleElement.Text()
  	}
  
  	if title == "" {
  		ogTitleElement := document.Find(`meta[property="og:title"]`)
  		if ogTitleElement != nil && ogTitleElement.Size() > 0 {
  			title, _ = ogTitleElement.Attr("content")
  		}
  	}
  
  	if title == "" {
  		titleElement = document.Find("post-title,headline")
  		if titleElement == nil || titleElement.Size() == 0 {
  			return title
  		}
  		title = titleElement.Text()
  	}
  
  	for _, delimiter := range titleDelimiters {
  		if strings.Contains(title, delimiter) {
  			title = extr.splitTitle(strings.Split(title, delimiter))
  			break
  		}
  	}
  
  	title = strings.Replace(title, motleyReplacement, "", -1)
  
  	if extr.config.debug {
  		log.Printf("Page title is %s\n", title)
  	}
  
  	return strings.TrimSpace(title)
  }
docs: // GetTitle returns the title set in the source, if the article has one