Graphic design problem [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Sun 2008-02-17 12:51
Graphic design problem
LinkReply
[personal profile] cjwatsonSun 2008-02-17 16:03

FWIW, I looked into doing this for myself today, and found that if you're already using Squid (as I am), then this is quite easy to set up without requiring new software. I have in /etc/squid/squid.conf:

redirect_program /etc/squid/redirector
acl LIVEJOURNAL dstdomain .livejournal.com
redirector_access LIVEJOURNAL

... and in /etc/squid/redirector:

#! /usr/bin/perl -w
use strict;

$| = 1;

while (<>) {
        my @args = split;
        my $url = $args[0];
        if ($url =~ m[^https?://[^/]*\.?livejournal\.com/] and $url !~ /\.bml/ and $url !~ /style=mine/) {
                my $newurl;
                if ($url =~ /\?/) {
                        $newurl = "$url&style=mine";
                } else {
                        $newurl = "$url?style=mine";
                }
                print "302:$newurl\n";
        } else {
                print "\n";
        }
}

I could probably do a better job of the redirector script, of course!

Reposted without auto-formatting. Grr.

Link Reply to this | Thread
[personal profile] cjwatsonSun 2008-02-17 16:12
And of course this buggers up deleting comments, as I just found out. :-) Making it also test $args[3] eq 'GET' fixes this.
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]