Пример #1
0
def index(url):
	response.content_type = 'application/json; charset=UTF-8'
	print"\n\n\n\n\n--------------------------------\n--- Getting Creation dates for:\n"+url+"\n\n"

	bitly = getBitlyCreationDate(url)
	print "Done Bitly"
	archives = getArchivesCreationDate(url)
	print "Done Archives"
	topsy = getTopsyCreationDate(url)
	print "Done Topsy"
	google = getGoogleCreationDate(url)
	print "Done Google"
	backlink = getBacklinksFirstAppearanceDates(url)
	print "Done Backlinks"
	lastmodified = getLastModifiedDate(url)
	print "Done Last Modified"
	lowest = getLowest([bitly,topsy,google,backlink,lastmodified,archives["Earliest"]])
	print "Got Lowest"

	result = []
	result.append(("URI", url))
	result.append(("Estimated Creation Date", lowest))
	result.append(("Last Modified", lastmodified))
	result.append(("Bitly.com", bitly))
	result.append(("Topsy.com", topsy))
	result.append(("Backlinks", backlink))
	result.append(("Google.com", google))
	result.append(("Archives", archives))

	values = OrderedDict(result)

	r = jsonlib.dumps(values, sort_keys=False, indent=2, separators=(',', ': '))
	print r
	return r
Пример #2
0
def getBacklinksCreationDates(url):
	links = getBacklinks(url)
	backlinks = []
	try:
		for link in links:
			bitly = getBitlyCreationDate(link)
			archives = getArchivesCreationDate(link)
			topsy = getTopsyCreationDate(link)
			google = getGoogleCreationDate(link)
			lowest = getLowest([bitly,topsy,google,archives["Earliest"]])
			if(lowest==""):
				continue
			backlinks.append(lowest)

	except:
		print sys.exc_info()
	return backlinks