Post Reply 
How to test a variable against another variable?
Oct. 10, 2008, 12:30 PM
Post: #9
RE: How to test a variable against another variable?
If you use "This is Google's cache of", this will only work for english people. In my case, being spanish, i see "Esta es la versión en caché de" so it will never match. Please let's tray doing global filters.

How? Taking "currentHost" from the actual url of the cache
Code:
$URL(*cache:*:(*)\5/*)$SET(currentHost=\5)

Code:
[Patterns]
Name = "Google cache: Add cache links to Google cache results page {whenever,ln}081010"
Active = TRUE
URL = "$TYPE(htm)[^/]+/search\?*q=cache"
Bounds = "$NEST(<a\s,</a>)"
Limit = 256
Match = "(*href="
        "$TST(V_Postbody=1)$URL((*cache:*:)\4(*)\5/*)$SET(currentHost=\5)"
        "$AV(http://$TST(currentHost)/\1|/\1)*)\2"
Replace = "\2<a href="http://www.google.com/search?q=cache:http://$GET(currentHost)/\1"><img src="http://www.google.com/favicon.ico" style="border: none;" /></a>"

I like this filter, thanks for it Wink

Updated: Changed "/search?hl=en&q=cache" to "/search?q=cache"
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to test a variable against another variable? - lnminente - Oct. 10, 2008 12:30 PM

Forum Jump: