05-24-2013, 12:40 +0200
AuthorPost
Immow  05-29-2007, 00:49   | rss and regex      Quote  Reply
Member since 05/2007
4 Posts
Hello,

I downloaded this script but want to filter the output, I was wondering if you people could help me with this.

http://immow.nl/rss-synd.tcl

The filtering I want is something like this:
Output now: [Mognet][JTV]Nobuta​_wo​_Produce​_-​_07[h264-HQ][C6A1EC14].​avi
output wanted: [Mognet][JTV]Nobuta​ wo​ Produce​ -​ 07[h264-HQ].​avi

As you can see I want to remove the _ and crc
CyBex  06-01-2007, 08:27   Jabber  ICQ  AOL IM  Yahoo IM  MSN  Homepage        Quote  Reply
nie da
(Administrator)

Avatar

Member since 01/2004
258 Posts
Location: Berlin
change from _ to space:

set text [string map [list "_" " "] $text]

remove the crc:

regexp {^(.*)\[.+?\](\..+)} $text "" t t2; set text $t$t2

mfG CyBex @ QuakeNet, UnderNet, EFNet, Freenode, euIRC, GameSurge & ShadowWorld - Files
Immow  06-01-2007, 17:12         Quote  Reply
Member since 05/2007
4 Posts
Thanks for your quick responds, where should I add those in the tcl file?
CyBex  06-01-2007, 18:13   Jabber  ICQ  AOL IM  Yahoo IM  MSN  Homepage        Quote  Reply
nie da
(Administrator)

Avatar

Member since 01/2004
258 Posts
Location: Berlin
i dont know your script, how can i know where you should add this??

please add it to http://paste.tclhelp.net and leave a link...

sorry, that i'm not answered in the channel, but i was moving home from work :)

mfG CyBex @ QuakeNet, UnderNet, EFNet, Freenode, euIRC, GameSurge & ShadowWorld - Files
Immow  06-01-2007, 19:30         Quote  Reply
Member since 05/2007
4 Posts
oh sorry, I my first post I put a link to the script.

here is the link via paste.tcl: http://paste.tclhelp.net/?id=9mq

Also funny to see that when I added this script to paste.tcl it said it contained some errors... But I did not modify it I only put some # in front of example code.
CyBex  06-01-2007, 19:52   Jabber  ICQ  AOL IM  Yahoo IM  MSN  Homepage        Quote  Reply
nie da
(Administrator)

Avatar

Member since 01/2004
258 Posts
Location: Berlin
I'm not 100% sure but try in this block (line 834)

                foreach line [split $msg "\n"] {
                    if {($type == 1) || ($type == 3)} {
                        putserv "NOTICE $chan :$line"
                    } else {
                        putserv "PRIVMSG $chan :$line"
                    }
                }

to:

                foreach line [split $msg "\n"] {

                    set line [string map [list "_" " "] $line]
                    regexp {^(.*)\[.+?\](\..+)} $line "" t1 t2
                    set line $t1$t2

                    if {($type == 1) || ($type == 3)} {
                        putserv "NOTICE $chan :$line"
                    } else {
                        putserv "PRIVMSG $chan :$line"
                    }
                }

mfG CyBex @ QuakeNet, UnderNet, EFNet, Freenode, euIRC, GameSurge & ShadowWorld - Files
Immow  06-01-2007, 21:07         Quote  Reply
Member since 05/2007
4 Posts
I think something went wrong ;)

Output: [Huzzah]​ Reideen​ 12​ .​mp4

Should be: [Huzzah]​ Reideen​ 12​.mp4

What could be the problem?
Advanced options for this topic:

Ignore this topic (Do not list this topic in the "unread topics" search. You are currently not ignoring this topic.)
Hide this topic (Hidden topics are not displayed in the topics list. This topic is currently not hidden.)
Go to forum

Unclassified NewsBoard 1.5.3-d | © 2003-4 by Yves Goergen