×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    IrcWikiSearch: Difference between revisions

    Content added Content deleted
    No edit summary
    No edit summary
    Line 1: Line 1:
    How to search (UseMod) wiki pages in IrC (the ugly way)
    <a href="http://get-nude-girls.com/"> http://get-nude-girls.com/ </a>

    http://get-nude-girls.com/
    *Setup an [EggDrops eggdrop] bot.
    <a href="http://fuck-your-self.com/"> http://fuck-your-self.com/ </a>

    http://fuck-your-self.com/
    *Load a [http://wiki.s23.org/wiki.pl?TCLScripts tcl script] like this:
    <a href="http://sexy--asians.com/"> http://sexy--asians.com/ </a>

    http://sexy--asians.com/
    ---
    <a href="http://sexy-photo-pics.com/"> http://sexy-photo-pics.com/ </a>

    http://sexy-photo-pics.com/
    Using
    <a href="http://funny--sex.com/"> http://funny--sex.com/ </a>
    <pre>
    http://funny--sex.com/
    set data10 [exec bash -c "/home/kallisti/egg/scripts/wiki.sh $text"];
    <a href="http://sex--winner.com/"> http://sex--winner.com/ </a>
    </pre>
    http://sex--winner.com/
    is a security risk, as everyone can run commands on your box. Don't do
    <a href="http://sex-in-bmw.com/"> http://sex-in-bmw.com/ </a>
    that. The code below is untested, but it should protect from exploits. -- thanks for your input, updated that.
    http://sex-in-bmw.com/

    <a href="http://hot-sex-pics-here.com/"> http://hot-sex-pics-here.com/ </a>
    <pre>
    http://hot-sex-pics-here.com/

    <a href="http://fucking--sucking.com/"> http://fucking--sucking.com/ </a>
    bind pub - !wiki wikisearch
    http://fucking--sucking.com/

    <a href="http://sex-on-public.com/"> http://sex-on-public.com/ </a>
    proc wikisearch {nick host hand chan text} {
    http://sex-on-public.com/
    set quotedtext [string map {\' \'\\\'\'} $text];
    <a href="http://247--sex.com/"> http://247--sex.com/ </a>
    set data [exec bash -c "/home/kallisti/egg/scripts/wiki.sh '$quotedtext'"];
    http://247--sex.com/
    regsub -all {
    <a href="http://nice-nude-sluts.com/"> http://nice-nude-sluts.com/ </a>
    } $data {} output;
    http://nice-nude-sluts.com/
    putlog "$output";
    <a href="http://sexy-girl-toying.com/"> http://sexy-girl-toying.com/ </a>
    putserv "PRIVMSG $chan :$output";
    http://sexy-girl-toying.com/

    <a href="http://sex-orgy-now.com/"> http://sex-orgy-now.com/ </a>
    }
    http://sex-orgy-now.com/

    <a href="http://busty--sluts.com/"> http://busty--sluts.com/ </a>
    </pre>
    http://busty--sluts.com/

    <a href="http://group-sex-dvd.com/"> http://group-sex-dvd.com/ </a>

    http://group-sex-dvd.com/
    ---
    <a href="http://ass-sex-vids.com/"> http://ass-sex-vids.com/ </a>

    http://ass-sex-vids.com/

    <a href="http://sex-for-bucks.com/"> http://sex-for-bucks.com/ </a>
    Yup,(almost) all it does is execute a shell script (wiki.sh), thats the ugly part about it ,because one could also do the whole job inside the .tcl (please add here if you like)
    http://sex-for-bucks.com/

    <a href="http://get-world-sex.com/"> http://get-world-sex.com/ </a>
    *add the wiki.sh
    http://get-world-sex.com/

    <a href="http://sex--mission.com/"> http://sex--mission.com/ </a>
    ---
    http://sex--mission.com/

    <a href="http://porn-in-life.com/"> http://porn-in-life.com/ </a>
    <pre>
    http://porn-in-life.com/
    #/bin/bash
    <a href="http://sex-porn-club.com/"> http://sex-porn-club.com/ </a>
    tempfile="wikisearch.tmp"
    http://sex-porn-club.com/

    <a href="http://real-xxx-porn.com/"> http://real-xxx-porn.com/ </a>
    echo "`grep -i -R -l -h $1 /var/www/wiki/page/* | cut -d/ -f7 | cut -d. -f1`" > $tempfile
    http://real-xxx-porn.com/
    wcount=`less $tempfile | wc -l`
    <a href="http://crazy--fuckers.com/"> http://crazy--fuckers.com/ </a>
    echo "Found '$1' in $wcount wiki pages. Outputting 1 random hit: http://wiki.s23.org/wiki.pl?`rl -c1 $tempfile` Find the rest on http://wiki.s23.org/wiki.pl?search=$1&dosearch=Go!"
    http://crazy--fuckers.com/
    </pre>
    <a href="http://sex--nation.com/"> http://sex--nation.com/ </a>

    http://sex--nation.com/
    ---
    <a href="http://ultra-sex-videos.com/"> http://ultra-sex-videos.com/ </a>

    http://ultra-sex-videos.com/
    This greps recursively thru /var/www/wiki/page/* (the place all the wiki pages are stored), uses "cut" to get the right piece of text and dumps it to a tempfile. Then it counts the number of hits using "wc" and outputs 1 random hit (using 'rl' = randomline command) and adds the link to the wiki search function.
    <a href="http://blowjob--sex.com/"> http://blowjob--sex.com/ </a>

    http://blowjob--sex.com/
    The result is :
    <a href="http://cock--sex.com/"> http://cock--sex.com/ </a>

    http://cock--sex.com/
    If you type !wiki <keyword> on a channel you can search the wiki pages for your keyword and click the right link without having to first go to the wiki search function.
    <a href="http://anal--lovers.com/"> http://anal--lovers.com/ </a>

    http://anal--lovers.com/
    thats it so far,, make it more elegant if you like..
    <a href="http://hardfucking-sluts.com/"> http://hardfucking-sluts.com/ </a>

    http://hardfucking-sluts.com/
    mutante
    <a href="http://after-party-sex.com/"> http://after-party-sex.com/ </a>
    http://after-party-sex.com/
    <a href="http://sexy--nurses.com/"> http://sexy--nurses.com/ </a>
    http://sexy--nurses.com/
    <a href="http://perfect--sex.com/"> http://perfect--sex.com/ </a>
    http://perfect--sex.com/
    <a href="http://mature-sex-action.com/"> http://mature-sex-action.com/ </a>
    http://mature-sex-action.com/
    <a href="http://bdsm--sex.com/"> http://bdsm--sex.com/ </a>
    http://bdsm--sex.com/
    <a href="http://incest--lovers.com/"> http://incest--lovers.com/ </a>
    http://incest--lovers.com/
    <a href="http://young--fuckers.com/"> http://young--fuckers.com/ </a>
    http://young--fuckers.com/
    <a href="http://very-sex-ladies.com/"> http://very-sex-ladies.com/ </a>
    http://very-sex-ladies.com/
    <a href="http://fucking--pussy.com/"> http://fucking--pussy.com/ </a>
    http://fucking--pussy.com/
    <a href="http://my-sexy-syster.com/"> http://my-sexy-syster.com/ </a>
    http://my-sexy-syster.com/

    Revision as of 22:06, 3 February 2005

    How to search (UseMod) wiki pages in IrC (the ugly way)

    • Setup an [EggDrops eggdrop] bot.

    ---

    Using

    set data10 [exec bash -c "/home/kallisti/egg/scripts/wiki.sh $text"];
    

    is a security risk, as everyone can run commands on your box. Don't do that. The code below is untested, but it should protect from exploits. -- thanks for your input, updated that.

    
    bind pub - !wiki wikisearch
    
    proc wikisearch {nick host hand chan text} {
      set quotedtext [string map {\' \'\\\'\'} $text];
      set data [exec bash -c "/home/kallisti/egg/scripts/wiki.sh '$quotedtext'"];
      regsub -all {
    } $data {} output;
      putlog "$output";   
    putserv "PRIVMSG $chan :$output";
    
    }
    
    


    ---


    Yup,(almost) all it does is execute a shell script (wiki.sh), thats the ugly part about it ,because one could also do the whole job inside the .tcl (please add here if you like)

    • add the wiki.sh

    ---

    #/bin/bash
    tempfile="wikisearch.tmp"
    
    echo "`grep -i -R -l -h $1 /var/www/wiki/page/* | cut -d/ -f7 | cut -d. -f1`" > $tempfile
    wcount=`less $tempfile | wc -l`
    echo "Found '$1' in $wcount wiki pages. Outputting 1 random hit: http://wiki.s23.org/wiki.pl?`rl -c1 $tempfile` Find the rest on http://wiki.s23.org/wiki.pl?search=$1&dosearch=Go!"
    

    ---

    This greps recursively thru /var/www/wiki/page/* (the place all the wiki pages are stored), uses "cut" to get the right piece of text and dumps it to a tempfile. Then it counts the number of hits using "wc" and outputs 1 random hit (using 'rl' = randomline command) and adds the link to the wiki search function.

    The result is :

    If you type !wiki <keyword> on a channel you can search the wiki pages for your keyword and click the right link without having to first go to the wiki search function.

    thats it so far,, make it more elegant if you like..

    mutante

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.