Unicode in Python

It’s a very long time since I have had to deal with binary code translations, but when dealing with HTML and JSON with Python, I need to get to grips with it. The € symbol for instance requires the extended character set support and rss should be written in utf-8. This page collects the notes I made in learning about Python’s support for unicode/ascii translations. Continue reading “Unicode in Python”

Web Site Testing with MaxQ

MAXQ is a web proxy with recording and replay features. It is designed to capture and replay tests. They are quite keen that one understands the terms of use of target sites since many prohibit automated access and these days it would seem defend themselves against it.  This article documents how to run MaxQ and make tests, but not how to successfully run them. (If that’s why you’ve come here, look elsewhere but if you have answers please comment here. ) Continue reading “Web Site Testing with MaxQ”

Converting dates to strings using Python

While working on converting ello.json to rss, I needed to convert the date formats, I needed to do it in Python and found the following code worked, using strptime and strfmtime. I had to augment the date string with the name of the day of the week attribute, so felt it had to via a date data type. (This is an important part of the requirement, since otherwise string manipulation would have been enough.) Finding exampes was hard, so I hope it helps, Continue reading “Converting dates to strings using Python”

Exporting ello.co

ello export a feed as JSON, here’s its name structure http://ello.co/username.json but you need to be logged in, god knows why; if not the file returns a version of the profile data. This post thus deals mainly with how to automate ello’s login, the problem of converting the JSON to XML is dealt with on a post of the same name. This post morphed into a generic web login via scripts.

Continue reading “Exporting ello.co”

Twitter API V1.1 (Deprecated)

This post was written in 2013 and I discovered in May 2018 that most of the links failed. It’s been a while, and it surprises me that my little wiki has lasted longer than the resources I point to, but not here. I could have deleted this post, but chose not to; I have heavily edited it so it’s as much a diary as the technical note it once was.

I missed the announcement that Twitter were upgrading their API. I only discovered it when they ran their “test blackouts”. It has broken. This means my ‘mingle’, friend feed and hence facebook feeds are now without my twitter goodness. The rest of this post lists then contemporary resources to help rescue the feeds. Continue reading “Twitter API V1.1 (Deprecated)”

Planet Planet

I started using Planet in about 2008 2006, it would seem? I rapidly came too “Planet Venus” and this article was written during that time,  and was copied from the snipsnap wiki, itself copied from my sun blog. This article focuses on installation and administration. It includes links to my scripts. Continue reading “Planet Planet”

Socket Programming

It has to be Python

Don’t ask.

Python and datetime

Links

Here are some links

Examples

An example of using datetime is

import time
import datetime
now=datetime.datetime.now() 

#now.tzinfo = 'GMT'; # fails, now.tzinfo is immutable

print now.ctime() print now.isoformat() print now.tzinfo

but otherwise produces the following output

Fri Jan  2 15:15:07 2009
2009-01-02T15:15:07.896000
None

I performed these tests on a windows XP box. tzinfo is empty is this a windows/configuration thing? I can test this with UNIX. I tried setting the TZ variable before running the program and it makes no difference. I found one reference that says Python datetime doesn’t do TimeZones.

Obviously, using the from statement would change the call syntax

from datetime import datetime
now=datetime.now()

should work