mhinze.com

links etc.




    Archive for June, 2007

    links for 2007-06-30

    Saturday, June 30th, 2007

    Simple Scraping with SubSonic.Sugar

    Friday, June 29th, 2007

    SubSonic.Sugar has some handy utilities.  Highly recommended.  The source is worth browsing too.

    static void Main()
    {
        foreach (string link in SubSonic.Sugar.Web.ScrapeLinks("http://mhinze.com/", false))
        {
            Console.WriteLine(link);
        }
    }

     

    image 

     

    Technorati tags: , ,

    links for 2007-06-28

    Thursday, June 28th, 2007

    links for 2007-06-27

    Wednesday, June 27th, 2007

    links for 2007-06-26

    Tuesday, June 26th, 2007

    links for 2007-06-25

    Monday, June 25th, 2007

    links for 2007-06-23

    Saturday, June 23rd, 2007

    links for 2007-06-22

    Friday, June 22nd, 2007

    Search Query Term Highlighter - HttpModule for ASP.NET

    Thursday, June 21st, 2007

    Sometimes I find it useful when, as I'm searching, result documents are presented with my search terms highlighted.  Like they do in Google's cache.

    So I decided to write an HttpModule to handle the highlighting.  I also thought it would be useful to log these terms.  This module can serve that purpose quite nicely with a little modification.

    I found an open source solution so I adapted it.  I ported most of the regular expressions and some of the logic from SEHL, the search engine query terms highlighter for PHP.

    Download: Search Term Highlighter HttpModule for ASP.NET

    To use this HttpModule in any ASP.NET web site, place the class file in your App_Code folder and add this to web.config in the system.web section:

    <httpModules>
        <add type="SearchTermHighlighterModule" name="SearchTermHighlighterModule"/>
    </httpModules>

     

    The HTML source it produces looks like this:

    <span class="highlight-search-query">Ishmael</span>

    So you'll need to include the style definition in your stylesheet:

    .highlight-search-query
    {
        background-color:Lime;
    }

     

    to get this( searching for [ishmael "some years ago" the] ):

     
    image 
     

    One item left on my TODO list is to use multiple CSS classes, so that each term can have it's own color.

     

     

    Technorati tags: , , ,

    links for 2007-06-21

    Thursday, June 21st, 2007
    © 2007 mhinze.com