Skip navigation.
Personalize your internet.

stan's blog


Just learned about Google Pre-fetching. If I can scan the content of these files from Outfoxed, I won't be limited to just re-ordering the results of one page. Yipee!

In other news, Python's handling of XML is abysmal. So many competing implementations. And the 4suite XSLT processor is horribly slow: 6 minutes to do a conversion that Firefox can do in 15 seconds. Argh! launched today. Some good points in this this comment on slashdot, tho he misses the potential of community bookmarks. Why don't people see the obviousious connection? Social bookmarks need social networks. It's that simple. And that's what Outfoxed is about.

Here's hoping we can get a search engine working for us again!

Generalizing URI's

The problem is how to encode statements (in Outfoxed reports) about a general class of URI's. For example, to express that every page at gets the tag "news", and not just the single front page which is represented by that trailing slash character. This is further complicated by a need to have a representative link in each report, which is a single page that can be visited.

My options, as I far as I can tell:

  • Rules of thumb From "", infer "**". From "", infer "**". From "" infer the exact page.
  • Seperate "target" and "link" properties "target" would follow either the adblocker convention of "**", or the Norton registry convention of "".

I would really like to do something similar to the format:

<item rdf:about="">
  <title>Metafilter | Community Weblog</title>
  <description>Comunity blog</description>
  <dc:subject>fun timewasting</dc:subject>
      <rdf:li resource="" />
      <rdf:li resource="" />

The problem for using this s

What happened to Visio?

Just a rant: What happened to Visio? It used to be such a cool program. Now it's just a big convoluted mess, a mess that had me swearing out loud as I atempted to create one simple architecture diagram. I need a cloud icon, where can I find it? No simple way to peak into each symbol set; I have to open and close each of the approximately 10 billion sets. I want to export to some graphic format; nope, there is no option. I had to "export as web page" and then dig through the auto-gen'd graphics to find my image. What a pain.

Javascript/Python Conversion

I really wish there was a way to make standalone Javascript code. I spent most of the day migrating bits of the old DB code into the new Python DB/web server.

One very useful bit is code to determine the base authority of a URI/URL. That's the line between parts of the authority that are top-level (e.g. "com", "de", "net", "jp"), from those that are under control of the site owner.

Here's the algorithm, first in Javascript:

/* => => =>
See my post here.
// TODO: this list should be updated from time to time, automatically.
// taken from
const gTopLevelDomainDict = 
// break authority into two parts: subdomain(s), and base authority
// e.g. --> [images,]
// --> [www,]
function splitAuthority(aAuthority)
	// walk down from right, stop at (but include) first non-toplevel domain
	chunks = aAuthority.split(/\./).reverse();
	var baseAuthority="";
	var subDomain="";
	var i=0;
	var foundBreak = false;
	for (i in chunks)
		if (!foundBreak) 
			baseAuthority = chunks[i] + (baseAuthority ? "." : "") + baseAuthority;
			subDomain = chunks[i] + (subDomain ? "." : "") + subDomain
		if (gTopLevelDomainDict[chunks[i]] != 1) foundBreak=true;
	return ([subDomain,baseAuthority])

// URI object to be returned
function URI(scheme,authority,subDomain,baseAuthority,path,query,fragment)
	this.scheme = scheme;
	this.subDomain = subDomain;
	this.baseAuthority = baseAuthority;
	this.authority = authority;
	this.path = path;
	this.query = query;
	this.fragment = fragment;
// function to split URI into its parts, returned as URI object
function decomposeURI(aURI)
	// Javascript doesn't like a question mark as the first item 
	// in a regex grouping. Why is that?
	// TODO: handle port #'s, query
	var uriDef =   "^(([^:/?#]+):)?(//([^/?#]*))?([^#]*)(#(.*))?"
	//              012            4  5          6      7 8
	var myRegEp = new RegExp(uriDef,"g")
	var m = myRegEp.exec(aURI);
	if (!m) return false;

	var scheme = m[2] ? m[2] : "";
	var authority = m[4] ? m[4] : ""; 
	var path = m[5] ? m[5] : "";
	var query = "";
	var fragment = m[8] ? m[8] : "";
	var s = splitAuthority(authority);
	var subDomain = s[0];
	var baseAuthority = s[1];
	return(new URI(scheme,authority,subDomain,baseAuthority,path,query,fragment))

// this function does a best-guess of what is important in a URI
// rules: if a specific file path is mentioned, we take exact URI
// else ...
// forceGeneralize is a boolean, which if true, means we should
// generalize even if there is a specific path mentioned in the URI.
function generalizeURI(aURI, forceGeneralize)
	var uriParts = decomposeURI(aURI) ;

	// only mess with http,https,and ftp schemes
	if (!((uriParts.scheme == "http") ||
				(uriParts.scheme == "https") ||
				(uriParts.scheme == "ftp")))
		return (aURI)	
	// generalize to base authority only if a specific page wasn't mentioned.
	if (forceGeneralize || 
	    ((uriParts.path=="") || (uriParts.path.lastIndexOf('/')==0)))
		if ((uriParts.subDomain=="") || (uriParts.subDomain=="www"))
			// e.g.
			return (uriParts.baseAuthority)
			// e.g.
			return (uriParts.authority);
		// e.g.
		return (aURI)

And here's the same code in Python.

Google Autolinks

Nice post at Google Autolinks. I hadn't heard of the project before, but it is good news for Outfoxed. I wondered how Google (and other serach engines) would react to Outfoxed re-ordering the search results. But if their toolbar is mucking with the rest of the web, then they can't really cry foul when someone mucks with their pages!


A day of connections:

Got an email from Ben Edelman, a PhD student at Harvard Law. He's done a ton of research into spyware and advertising. He's done some impressive network snooping, but I'm even more impressed with the legal angle. If I had another lifetime to try, I'd learn a lot more about law.

Also got a good response from Eric at spywarewarrior, and he clued me in to the amazing AGNIS List: 11,000 nasty domains all categorized into spyware/adware/dialers/advertising and such.

XML feed