vrijdag 4 juli 2008


You certainly know the problem: you have literally hundreds of websites asking you to invent a username and a password, which you'll have to remember potentially weeks or even months later. Well there's a solution:

OpenId works as follows :
1. You log into a website with your openid "URL" : Mine for example is http://kserry.blogspot.com/
2. de webpage you want to login to is redirecting you to your provider.
3. on the providers' website you login with your credentials (this is the only you'll have to remember)
4. the providers' website redirects to back to your original website and you'll either be presented with a form (without the fields you allowed your openid provider to see to external parties and without the username/password)

How this works [Technical]

woensdag 2 juli 2008

Migrated pebble to blogger

Thanks to the guys from google we got a API to post items to our blog. Since I've had a pebble blog for some time now, but I don't have access to that server anymore, the time had come to use something with less maintenance (read none).

Hereunder you can find the code I've used to migrate the entries. Note: There are 2 steps 1. use an xslt to transform the pebble xml to an 'atom' xml. 2. use the python script to upload The xslt

<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/blogs">
<xsl:for-each select="blogEntry">
<entry xmlns='http://www.w3.org/2005/Atom'>
<published><xsl:value-of select="date"/></published>
<updated><xsl:value-of select="date"/></updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post"/>
<title type='text'><xsl:value-of select="title"/></title>
<content type="html"><xsl:value-of select="body"/></content>
<name>Koen Serry</name>
Here is the python script.
import httplib,urllib,re
from string import Template

params = urllib.urlencode({'Email': '', 'Passwd': '', 'service': 'blogger', 'source': 'exampleCo-exampleApp-1.0'})
headers = {"Content-type": "application/x-www-form-urlencoded"}
conn = httplib.HTTPSConnection("www.google.com")
response = conn.getresponse()
print response.status
data = response.read()
print data

auth = re.search('Auth=(.*)$',data).group(0)
print auth

s = Template("""


Koen Serry


f = open("blog.txt")
title = f.readline().rstrip()
content = " ".join(f.readlines())
params = s.substitute(header=title,payload=content)
headers = {"Authorization": "GoogleLogin auth="+auth,'Content-Type': 'application/atom+xml'}

conn = httplib.HTTPConnection("www.blogger.com")

response = conn.getresponse()
print response.status
data = response.read()
print data