Post Reply 
How to test a variable against another variable?
Aug. 21, 2008, 03:03 PM
Post: #4
RE: How to test a variable against another variable?
(Aug. 21, 2008 04:04 AM)whenever Wrote:  The next step is to match only the urls from the same host. I tried below code but it seems the $GET command can't be expanded in match field just like the help file stated:
Code:
<a*href=$AV($GET(currentHost)/\2)*</a>
Finally worked out a way by using a memory block list for the hostname match.

The below filter is just for demonstrating the technique and may not ready for real use.
Code:
[Patterns]
Name = "Add cache links to Google cache results page"
Active = TRUE
URL = "[^/]+/search\?*q=cache"
Limit = 256
Match = "(This is Google*s cache of <a[^>]+>http://\1/*</a>)\0$SET(currentHost=\1)$ADDLST(Mem-Temp,\1)|"
        "(<a*href=$AV(http://$LST(Mem-Temp)/\1|/\1)*</a>)\0$SET(2= <a href="http://www.google.com/search?hl=en&q=cache:http://$GET(currentHost)/\1"><img src="http://www.google.com/favicon.ico" style="border: none;" /></a>)"
Replace = "\0\2"
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to test a variable against another variable? - whenever - Aug. 21, 2008 03:03 PM

Forum Jump: