Development
Patching Aggie's referrer
Freshness Warning
This blog post is over 21 years old. It's possible that the information you read below isn't current and the links no longer work.
31 Jan 2003
Inspired by Les Orchard’s patching of AmphetaDesk to fix the referrer problem, I’ve patched Aggie.
This patch will change Aggie’s behavior to conform to the HTTP specs. When Aggie requests an RSS feed, the referrer header is now blank, and if the user configured a WeblogURL in Aggie.xfg, that URL will be added to the User-Agent header.
The only changes are a few lines in AggieRequest, but I’m including the entire AggieRequest class here for convenience.
public class AggieRequest { private const int defaultTimeout_ = 60000; private const string aggieBase_ = @"http://bitworking.org/AggieReferrers.html"; private static string referer_ = ""; private static string userAgent_ = VersionInfo.UserAgent + " (" + Environment.OSVersion.ToString() + "; .NET CLR " + Environment.Version.ToString(); public static string WeblogUrl { set { if (null != value && String.Empty != value) { userAgent_ = "; From: userAgent_ + value + ")"; } else { userAgent_ = userAgent_ + ")"; } } } public static HttpWebRequest CreateRequest(string url) { WebRequest req = WebRequest.Create(url); HttpWebRequest wreq = req as HttpWebRequest; if (null != wreq) { wreq.UserAgent = userAgent_; wreq.Referer = referer_; wreq.Timeout = defaultTimeout_; } return wreq; } }
This patch is released under the same licensing terms as Aggie itself, which if I remember correctly is the MIT License.
I’ve compiled Aggie 1.0 RC4 with this patch using SharpDevelop and it works for me. No guarantees are made that it will work for you, although I can’t think of any reason why it wouldn’t.