Looking at my bookmarking habits

So, I have finally been able to get the time stamps out of the html file into which I had exported my bookmarks. But preliminary analysis doesn't make much sense. So, I used the BeautifulSoup and time python library to extract and make sense of the time stamps. So, chrome stores the time stamps in this format - '1402120115'. You can look at this if you want to understand the time stamps.

Now here are the weird parts
1. It thinks that all of the bookmarks were made in 2014
2. It thinks that all of the bookmarks were made in the 6th month i.e June.
3. It doesn't show any bookmarks on the 1-6 days of the month
4. The hour stamps are GMT and not GMT +0530 which is Indian Standard Time.

The html file is available in blog and here's the code -

import numpyimport matplotlib.pyplot as pltimport BeautifulSoup
import time 

soup = BeautifulSoup.BeautifulSoup(open('bookmarks.html'))
allAttrs = [tag.attrs for tag in soup.findAll('a')]
dates = []for string in allAttrs:        try :                dates.append(str(string[1][1]).strip('u'))        except IndexError :                print string 

dateList = numpy.asarray(dates, dtype=int)
plt.hist(dateList)plt.show()
print len(dateList)

yearList = []monthList = []dayList = []hourList = []
for date in dateList:        temp = time.gmtime(date)        yearList.append(temp.tm_year)        monthList.append(temp.tm_mon)        dayList.append(temp.tm_mday)        hourList.append(temp.tm_hour)

yearList = numpy.asarray(yearList)monthrList = numpy.asarray(monthList)dayList = numpy.asarray(dayList)hourList = numpy.asarray(hourList) + 5 

print min(yearList), max(yearList)print list(set(yearList))print list(set(monthList))print list(set(dayList))print list(set(hourList)) 

plt.hist(yearList)plt.show()plt.hist(monthList,bins=12)plt.show()plt.hist(dayList,bins=31)plt.show()plt.hist(hourList,bins=24)plt.show()
I'll try correct for the mistakes and see if things change.

Popular posts from this blog

Animation using GNUPlot

Arxiv author affiliations using Python

Thoughts on the National Deep Tech Startup Policy