Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🌈

Klaus Alexander Seistrup kseistrup

💭
🌈
View GitHub Profile
@kseistrup
kseistrup / selenium-screenshotting.md
Created Mar 25, 2016 — forked from dannguyen/selenium-screenshotting.md
Using Selenium and Python to screenshot a javascript-heavy page
View selenium-screenshotting.md

Using Selenium and Python to screenshot a javascript-heavy page

As websites become more JavaScript heavy, it's harder to automate things like screenshotting for archival purposes. I've seen examples and suggestions to use PhantomJS for visual testing/archiving of websites, but have run into issues such as the non-rendering of webfonts. I've never tried out Selenium until today...and while I'm not thinking about performance implications yet, Selenium seems far more accurate than PhantomJS...which makes sense since it actually opens a real browser. And it's not too hard to script to do complex interactions: here's an [example of how to log in to Twitter, write a tweet, upload an image, and send a tweet via Selenium and DOM element selection](https://gist.github.com/dannguyen/8a6fa49253c1d6a0eb92

View musickiller-d.json
{
"info": "id/musickiller",
"zeronet": {
"": "1MKXRXyrPPZWdgw7HLuNGojAUFFirCfdPE",
"blog": "1MKBZ94qaYjane2ixERDbBEazjUg2N9A9T",
"chat": "1MKCZy4C7B7DHKxBvh3zCWYFvCSsXNsWVm"
}
}
View musickiller-id.json
{
"country": "RU",
"locality": "MOCKBA",
"name": {
"formatted": "Music Killer"
}
}
@kseistrup
kseistrup / twtxt-forever.sh
Last active Feb 25, 2016
Bash loop to post twtxt ‘tweets’ forever
View twtxt-forever.sh
#!/bin/bash
MY_PROMPT='twtxt> '
my_ruler () {
local ruler=''
local length=8
local ten='----+----|'
local maxlen="${COLUMNS:-140}"
[[ ${maxlen} -gt 140 ]] && maxlen=140
View ciphers.sh
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1:443
# Delay after each test
DELAY=0
# Ciphers to test
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
# Some nice colours :)
@kseistrup
kseistrup / onename.md
Last active Aug 29, 2015
OneName verification
View onename.md
View aob.py
#!/usr/bin/python
# Audio extraction script for All of Bach:
# http://allofbach.com/en/
import re
import urllib2
from BeautifulSoup import BeautifulSoup
page = urllib2.urlopen('http://allofbach.com/en/bwv/')
soup = BeautifulSoup(page)
@kseistrup
kseistrup / twc-setprofile
Last active Aug 29, 2015
Python script to easily set your profile parameters on Twister
View twc-setprofile
#!/usr/bin/python3.3
# -*- mode: python; coding: utf-8 -*-
"""
usage: twc-setprofile [-h] [-v] [--copyright] [-d] [-c CONFIG] [-z]
[-n FULLNAME] [-b BIO] [-l LOCATION] [-u URL]
[-m BITMESSAGE] [-t TOX] [--nn] [--nb] [--nl] [--nu]
[--nm] [--nt]
USER
positional arguments:
View twc-setavatar
#!/usr/bin/python3.3
# -*- mode: python; coding: utf-8 -*-
"""
Usage: twc-setavatar [OPTIONS]
options are:
-h, --help ........ show this help text and exit
-v, --version ..... print version information and exit
"""
##############################################################################
# This program is free software; you can redistribute it and/or modify it #
@kseistrup
kseistrup / twc
Created Apr 19, 2014
Prototype of the master twister client: twc
View twc
#!/bin/sh
# -*- mode: sh; coding: utf-8 -*-
##############################################################################
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; either version 3 of the License, or (at your option) #
# any later version. #
# #
# This program is distributed in the hope that it will be useful, but with- #