This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# KPI 22. Domain content history | |
# values: <=2000 (1.2) / 2001-2005 (1.1) / 2006-2010 (1.05) / 2010-2015 (1.025) / 2016+ (1) | |
# min/max = 1/1.2 | |
require 'domainator' | |
require 'wayback' | |
domain = Domainator.parse(url) | |
Wayback.list(domain).first_date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# KPI 1. Domain dynamics | |
# values: None (1) / Small (1.1) / Medium (1.3) / Large (1.5) | |
# min/max = 1/1.5 | |
# get the domain root of the result link url | |
root = URI.parse(url).host # root = URI.join url, '/' | |
html = Nokogiri::HTML(open(root)) | |
# if not collected before parse html for dates | |
unless Domain.exists?(root) |