Post Reply 
n00b could use some help
Feb. 18, 2009, 10:50 PM
Post: #1
n00b could use some help
Hi,

I would like to use Proxomitron to kill any site that includes certain key words in the body of the page. For instance, if a site contains the word "ebay" anyplace, block it.

I figured out how to use the web page filter to replace the word "ebay" with any other text, but is there a way to actually stop loading the page once the word "ebay" is found?

Also, if there is, how could I set it up to allow "ebay", but if both "ebay" and "ipod" are present, to block the page?

Thanks in advance for your help!

PS The reason I am using Proxomitron is simply because it is portable. I need a solution that I can carry with me on my flash drive... Smile!
Add Thank You Quote this message in a reply
Feb. 18, 2009, 11:19 PM
Post: #2
RE: n00b could use some help
The easiest way but not the smartest:

Code:
First web filter___________
Match code= (word1|word2|word3....)$SET(GreetingsEarthling=1)PrxFail$TST()

Second filter_____________
Match code=(word1|word2|word3....)$TST(GreetingsEarthling=1)
Replace code=\k
Add Thank You Quote this message in a reply
Feb. 19, 2009, 12:02 AM
Post: #3
RE: n00b could use some help
(Feb. 18, 2009 10:50 PM)GreetingsEarthling Wrote:  I would like to use Proxomitron to kill any site that includes certain key words in the body of the page.

could you please explain in more detail?

is your end-in-mind for your web browser to show a completely BLANK page if a "profane word" is encountered ???

if so, the \k Proxo command won't quite get you there because the page will still be rendered "up to but not including" said 'profane word'... ie, images will be loaded...


i may be misreading your end-in-mind... please clarify in more detail...
Add Thank You Quote this message in a reply
Feb. 19, 2009, 04:10 AM
Post: #4
RE: n00b could use some help
ProxRocks,

Yeah, what I'm hoping for is that whenever a "bad word" (whatever that might be) appears in a page, that the whole page would be replaced by the message "Connection Killed" as with the AdList header filter.

Inminente,

Thank you so much, that worked exactly as you said it would! But as I said, ideally the whole page would be rejected, not just the part following the "bad word".
Add Thank You Quote this message in a reply
Feb. 19, 2009, 02:17 PM
Post: #5
RE: n00b could use some help
The same filter than before but smarter, it will not blank a full page. Now you can select how many words have to match. Now is set for matching to words, if you want to match more words place more '1' in $TST(limitWords=11)

Code:
[Patterns]
Name = "LimitWords {ln}090219"
Active = TRUE
Limit = 30
Match = "(word1|word2|word3...)"
        "$SET(limitWords=$GET(limitWords)1)"
        "$TST(limitWords=11)"
Replace = "\k"

I ended here, hope someone blanks the page for you Wink
Add Thank You Quote this message in a reply
Feb. 19, 2009, 06:07 PM
Post: #6
RE: n00b could use some help
GE;

Hi, and welcome to TUOPF! Smile!

ProxRocks is correct, a simple \k by itself won't do the trick. The reason is easy to see: once Proxo has filtered a chunk of text, it lets the results go to the browser, and AFAIK, no browser delays the display of incoming data. At least, under normal circumstances. D'oh! All that means that you'll see everything up to the naughty word(s), and that can't be helped.

However.....

As demonstrated by Inminente above, Proxo can set variables, and can test for them in later filters. Here's a scenario, untested, that might do what you wish.

A filter could, conceivably, take a 32K chunk of data with no textual bounds. Test that chunk for the no-no word(s). If found, the Replace string becomes \k, and it's all over but the shouting. If not found, then the entire contents of the chunk are stuffed into a successively numbered variable, and the Replace string remains empty. Result: nothing is passed to the browser, so the screen remains empty.

Now, after this filter has processed the whole page, another filter pops all the variables off the stack, and everything is sent to the browser. But if the \k has been issued, this filter won't ever kick off, and all of the variables will be discarded, which still gives you a blank screen.

Cumbersome, to say the least. And if you want other filters, you'll need to turn on Multi, which raises questions of interactivity vis-a-vis the assigned variable numbers. Still it's an idea, albeit untested.... that's an exercise best left to the reader. Whistling

Good luck!



Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Feb. 19, 2009, 07:48 PM
Post: #7
RE: n00b could use some help
Maybe do a...
Code:
</xmp></textarea></noscript></script></object></embed></iframe>
<script>location.replace("http://local.ptron/killed.html");</script>
... instead of a \k...
Add Thank You Quote this message in a reply
Feb. 20, 2009, 12:37 AM
Post: #8
RE: n00b could use some help
Nice Sidki! It blanks the page while javascript enabled. \k must be keeped or disabling javascript the filter wouldn't do anything.

Code:
[Patterns]
Name = "LimitWords {ln,sidki}090220"
Active = FALSE
Limit = 30
Match = "(word1|word2|word3...)"
        "$SET(limitWords=$GET(limitWords)1)"
        "$TST(limitWords=11)"
Replace = "</xmp></textarea></noscript></script></object></embed></iframe>"
          "<script>location.replace("http://local.ptron/killed.html");</script>"
          "\k"
Add Thank You Quote this message in a reply
Feb. 20, 2009, 03:50 AM
Post: #9
RE: n00b could use some help
Guys, thank you so much for your help so far! You are awesome.

I used inminente's suggestion for applying sidki's method, and it works like a charm! So long as the server is responding quickly, the page seems to "flash" quickly and then disappears!

Let me make sure I've got the other part of this right. When I use this, for instance:

"(we|hold|these|truths|to|be|self-evident)"
"$SET(limitWords=$GET(limitWords)1)"
"$TST(limitWords=111)"

it blocks a page that finds any two instances of those words, right? That seems to be what's happening for me. limitWords=11 blocks pages with one instance, limitWords=111 blocks any page with two instances, and so on?
Add Thank You Quote this message in a reply
Feb. 20, 2009, 05:02 AM
Post: #10
RE: n00b could use some help
Code:
we hold these

Code:
we <= limitWords = 1
hold  <= limitWords = 11
these  <= limitWords = 111 ("these" is replaced)

It would block pages with three instances of any word that is in the list of words. So whether it is "we, we, hold" or "truths we hold" or "to be these", it will match the third instance Wink
Visit this user's website
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: