Esempio n. 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
Esempio n. 2
0
def carbonDate(url):
    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 = json.dumps(values, sort_keys=False, indent=2, separators=(',', ': '))
    print r
    return lowest
Esempio n. 3
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
Esempio n. 4
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
Esempio n. 5
0
def index(url):
    response.content_type = 'application/json; charset=UTF-8'
    print "\n--- Getting Creation dates for:\n" + url + "\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)
    #Corren: changed json call to simplejson due to runtime error
    r = simplejson.dumps(values,
                         sort_keys=False,
                         indent=2,
                         separators=(',', ': '))
    print r
    #Corren: extract the just desired element
    createDate = values['Estimated Creation Date']
    return createDate