Post Reply 
Adding keywords with an incrementing counter
May. 02, 2011, 09:22 AM
Post: #1
Adding keywords with an incrementing counter
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?
Add Thank You Quote this message in a reply
May. 08, 2011, 04:37 PM
Post: #2
RE: Adding keywords with an incrementing counter
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
Add Thank You Quote this message in a reply
May. 09, 2011, 10:08 AM
Post: #3
RE: Adding keywords with an incrementing counter
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"
Add Thank You Quote this message in a reply
May. 10, 2011, 01:23 AM
Post: #4
RE: Adding keywords with an incrementing counter
(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
Add Thank You Quote this message in a reply
May. 10, 2011, 04:54 PM
Post: #5
RE: Adding keywords with an incrementing counter
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)
Add Thank You Quote this message in a reply
May. 10, 2011, 06:20 PM (This post was last modified: May. 11, 2011 01:13 PM by JJoe.)
Post: #6
RE: Adding keywords with an incrementing counter
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
Add Thank You Quote this message in a reply
May. 11, 2011, 10:28 AM
Post: #7
RE: Adding keywords with an incrementing counter
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".
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: