Skip to content

Instantly share code, notes, and snippets.

View eigilhs's full-sized avatar

Eigil Skjæveland eigilhs

View GitHub Profile

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 March 4, 2013 14:47
Script for å hente album art til album basert på mappestrukturen ([artist]/[album])
#!/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 March 4, 2013 14:45
Script for å vise Dilbert-striper
#!/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 December 14, 2015 11:58
Script for å laste ned alle filene fra en apache-index
#!/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':