home

author: niplav, created: 2019-07-24, modified: 2020-04-08, language: english, status: in progress, importance: 5, confidence: log

The blog bit-player is an excellent computer science and mathematics blog written by Brian Hayes). Like many other blogs, it is not built for complete chronological reading. This page makes that easier.

Bit-Player Posts Chronological Index

This index currently contains 377 posts from 2006-01-09 to 2019-09-27.

Archives

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

Code

The site was scraped using Python 2 with the libraries urllib2 and BeautifulSoup:

import urllib2
from bs4 import BeautifulSoup
import sys
import datetime

for year in range(2006, datetime.datetime.now().year+1):
    yearposts=[]
    for page in range(1, 1000):
        url='http://bit-player.org/{}/page/{}'.format(year, page)
        req=urllib2.Request(url, headers={'User-Agent' : "Firefox"})
        try:
            con=urllib2.urlopen(req)
        except urllib2.HTTPError, e:
            break
        data=con.read()
        soup=BeautifulSoup(data, 'html.parser')
        posts=soup.find_all(class_="post")
        for p in posts:
            title=p.find_all(class_="entry-title")[0].a.text
            link=p.find_all(class_="entry-title")[0].a.get('href')
            meta=p.find_all(class_="entry-meta")
            author=p.find_all(class_="entry-meta")[0].find_all(class_='author')[0].a.text
            date=p.find_all(class_="entry-meta")[0].find_all(class_='entry-date')[0].text
            entry='* [{}]({}) ({}, {})'.format(title.encode('utf_8'), str(link), str(author), str(date))
            yearposts.append(entry)
    print('\n### {}\n'.format(year))
    for t in reversed(yearposts):
        print(t)