Skip to content

Instantly share code, notes, and snippets.

Avatar

Eigil Skjæveland eigilhs

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am eigilhs on github.
  • I am eigilhs (https://keybase.io/eigilhs) on keybase.
  • I have a public key ASB7hrpj-pcpo3dmVT1Lwl9V4vrK7nkQVBrNX3MHyrSvwgo

To claim this, I am signing this object:

@eigilhs
eigilhs / aart.py
Created Mar 4, 2013
Script for å hente album art til album basert på mappestrukturen ([artist]/[album])
View aart.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, re, sys
from urllib import FancyURLopener
class _StealthOpener(FancyURLopener):
version = 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) \
Gecko/20120827 Firefox/10.0.7'
@eigilhs
eigilhs / dilbert.py
Created Mar 4, 2013
Script for å vise Dilbert-striper
View dilbert.py
#!/usr/bin/env python
import os, re, sys, urllib, random, datetime, time
root = "http://www.dilbert.com/"
address = root + "fast/" # today's strip
if len(sys.argv) == 2 and sys.argv[-1] != "-r": # specified strip
date = re.findall("\d\d\d\d\-\d\d\-\d\d", sys.argv[1].strip())
if date: address += date[0] + "/"
@eigilhs
eigilhs / index_mine.py
Last active Dec 14, 2015
Script for å laste ned alle filene fra en apache-index
View index_mine.py
#!/usr/bin/env python
import os, re, sys, urllib
magic_key = r'</td><td><a href="(.+)">.+</a>.*</td><td align="right">'
def mine(root):
for line in urllib.urlopen(root):
for m in re.findall(magic_key, line):
if m != 'Parent Directory':