The Un-Official Proxomitron Forum
Adding keywords with an incrementing counter - Printable Version

+- The Un-Official Proxomitron Forum (https://www.prxbx.com/forums)
+-- Forum: Proxomitron Config Sets (/forumdisplay.php?fid=43)
+--- Forum: Sidki (/forumdisplay.php?fid=44)
+--- Thread: Adding keywords with an incrementing counter (/showthread.php?tid=1755)



Adding keywords with an incrementing counter - sh8an - May. 02, 2011 09:22 AM

Hi all. i am stripping noindex tags (mainly ads in my case). in order to give myself a visual aid wanted to add a keyword with an incrementing counter to the site.
test version which i came up and which obviuously doesn't work
Code:
[Patterns]
Name = "Test keyword"
Active = FALSE
Limit = 256
Match = "$SET(keyword=some.noindex_strip:2)"
        "$TST(keyword=(\1|)(noindex_strip:([0-9]++)\2.|.))"
        "$TST((\2+)=$LST(Count)|*)"
        "$SET(keyword=$GET(keyword)noindex_strip:$GET(i).)"
Replace = "1: \1\r\n"
          "2: \2\r\n"
          "key: $GET (keyword)"
the sites might or might not have any keywords set previously.

with sidki's latest config is there a better way and place to accumulate and later display arbitrary data relating to site?


RE: Adding keywords with an incrementing counter - JJoe - May. 08, 2011 04:37 PM

Adding a keyword and a counter seems reasonable, I guess.

Quote:which obviuously doesn't work

Maybe some examples

Code:
[Patterns]
Name = "Count <div Example 1"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 256
Match = "<div"
        "$TST(($GET(DivCount)+)=$LST(Count)|*)$SET(DivCount=$GET(i))"
        "PrxFail$TST()"
        "|"
        "(^(^<ProxBottom>))$STOP()"
        "$SET(keyword=$GET(keyword).DivCount=$GET(DivCount).)"
        "$SET(DivCount=)"
        "PrxFail$TST()"

Code:
[Patterns]
Name = "Count <div Example 2"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 256
Match = "<div"
        "$TST(($GET(DivCount)+)=$LST(Count)|*)$SET(DivCount=$GET(i))"
        "$TST(keyword=.(*.)\0DivCount*.\1|.+\0)"
        "$SET(keyword=.\0DivCount=$GET(DivCount).\1)"
        "PrxFail$TST()"
        "|"
        "(^(^<ProxBottom>))$STOP()"
        "$SET(DivCount=)"
        "PrxFail$TST()"

I've used PrxFail$TST() to break the match but the variables are still set.
Example 1 should be quickest and easiest to add to your filter.
Example 2 preserves keyword order.

Notes:
Both examples preserve any existing keyword info.
$SET(keyword=some.noindex_strip:2) would overwrite the existing or current keyword and probably isn't what you want to do.

Use a named (global) variable to share info between filtering events. Variables \0-9 are per filter and lost when a filter closes.

HTH


RE: Adding keywords with an incrementing counter - sh8an - May. 09, 2011 10:08 AM

thanks. i went the long way Smile!
Code:
[Patterns]
Name = "TAG: noindex adbann II {sh8an}"
Active = TRUE
Multi = TRUE
URL = "(^$TST(keyword=*.noindex:1.*))$TYPE(htm)"
Bounds = "<noi(n|)dex([^>]++|)>*</noi(n|)dex([^>]++|)>"
Limit = 8000
Match = "\9"
        "("
        "$TST(keyword=noindex_strip:([0-9]++)\2.)$SET(keyword=)|"
        "$TST(keyword=\1.noindex_strip:([0-9]++)\2.)$SET(keyword=\1.)|"
        "*"
        ")"
        "$TST((\2+)=$LST(Count)|*)"
        "$SET(keyword=$GET(keyword)noindex_strip:$GET(i).)"
Replace = "<div id=adbann>\r\n"
          "removed \r\n"
          "</div>\r\n"



RE: Adding keywords with an incrementing counter - JJoe - May. 10, 2011 01:23 AM

(May. 02, 2011 09:22 AM)sh8an Wrote:  i am stripping noindex tags (mainly ads in my case).

If suitable for a public post, may we have an address?
If not suitable but legal, perhaps by private message or email.

Thanks


RE: Adding keywords with an incrementing counter - sh8an - May. 10, 2011 04:54 PM

hmmm i'm just wondering how to not make an additional advertisement for the sites (plus spoil the filter) coz the comment tag encapsulation of the ads in the russian web is slowly going away ;(
so here's a quick example ulibnulo just add the a.m. nTLD zone Smile!
basically it is common on news rotation sites and they put huge towers on both sides (i think i even saw a bottom one somewhere)


RE: Adding keywords with an incrementing counter - JJoe - May. 10, 2011 06:20 PM

Hmmm
Quote:Russian search engines Yandex and Rambler introduce a new tag which only prevents indexing of the content between the tags, not a whole Web page.

<body>
Do index this text block.
<noindex>Don't index this text block</noindex>
</body>

How reliable is targeting <noindex> tags? I have found one false positive.

Edit: Quote from http://en.wikipedia.org/wiki/Noindex


RE: Adding keywords with an incrementing counter - sh8an - May. 11, 2011 10:28 AM

well it is actually sometimes way off the mark, because some sites are putting in scrolling current user comments blocks, tag clouds, menus and etc.
but most such sites are one-time visit for me (or rare at best) so i don't care much for stripping out too much. as long as the piece of text that i came after is available. and since i came from a search engine it is definitely not within those tags.
just in case i altered the prox-menu to allow noindex and filter (^$TST(keyword=*.noindex:1.*))

actually i didn't know the tag was not in an "official list".