Flangy > Software Development > Manila Referal Tool
Manila is the weblogging app that comes with Frontier. I'm using UserLand's free Manila hosting for The Flangy News (I really ought to move the site already.) The referal site got really crowded when my site got indexed by Google, so I thought it would be useful to be able to separate out the search engine hits and show the search terms without the full URL.
Referal Tool tries to hit the referal page of the configured site, saving the page locally if it can. Then the URLs are parsed out of the page and separated out into categories: local searches, search engine hits, aggregator hits, and regular hits.
Local Searches are just Google hits that are limited to my site only. The aggregator code isn't entirely developed, but it's meant to weed out hits from various RSS readers.
The generated report is saved out as HTML, so the report doesn't have to be generated on each view. This also keeps the last report viewable if EditThisPage falls off the web, which it does occasionally.
Referal Tool in action: dolog.py. The script has code to send its own source to the browser.
Features have accumulated to the point where the script should be refactored. The RSS Aggregator code could be fleshed out. I'd also like to be able to flag hits as "well known", give them a name, and show them in a different section. So for instance I could flag the Pocket IGN page that mentions Wasteland Advance.