The Un-Official Proxomitron Forum
[Kye-U] Google Alternate Display... - 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: [Kye-U] Google Alternate Display... (/showthread.php?tid=1256)

Pages: 1 2


[Kye-U] Google Alternate Display... - ProxRocks - Feb. 08, 2009 07:05 PM

Kye-U,

kind of curious, if you do a Google Search for "showimage.htm", you get a "did you mean" 'top 2 results shown' tidbit...

below those two results is a "line", but the line only spans roughly 3/4 of the page...

can it be altered so that it spans the same width as the shaded every-other search result?


RE: [Kye-U] Google Alternate Display... - Kye-U - Feb. 08, 2009 07:11 PM

Definitely! I'll have it fixed after I get some food Wink

EDIT:

Code:
[Patterns]
Name = "Google Search: Alternate Display     9.01.30 (multi) [sd] (d.s) ku-20090208"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)www.google.[^:/]+/(intl/[^/]+/(^?)|search\?(^q\=cache:)|webhp|(^?))$SET(keyword=$TST(keyword=\1.(i_layout:[#*:0].)+\2)\1.i_layout:2.\2)"
Limit = 2048
Match = "(^?)$SET(a=)$SET(b=)$STOP()"
        "|"
        "<br>((\r|)\n$SET(1= )| <br>( <table)\2$SET(1=</p><br class=mainspace>\2))"
        "|"
        "<("
        "/b> of (about )+<b>[0-9,]+</b> ((from|over the) $NEST(<b>,</b >) )+for <b>( <b>)+[^<]+"
        "&&((<*>|?)+{95})\2???$SET(1=<\2...\3\4\5)*|$SET(1=<\2\3\4\5)\2"
        ")(*</table > )\3(<div(^ id=)$INEST(<div,>)$SET(5=<div)|)$SET(4=<div id="topspace">&nbsp;</div>\r\n)"
        "|"
        "<style(^$TST(b=s))$SET(b=s)$SET(1="
        "<script>"
        "var prxSpics=["http://local.ptron/sidki_h_$GET(cfg)/Google/google-","
        "new Image(),new Image(),new Image()];"
        "prxSpics[1].src=prxSpics[0]+"bug.png";prxSpics[2].src=prxSpics[0]+"top.png";"
        "prxSpics[3].src=prxSpics[0]+"new.png";"
        "</script>"
        "<style id="themed""
        ")"
        "|"
        "<div ("
        "id=("
        "$AV(ie6tb)>$INEST(<div,</div)</div >( $NEST(<script,</script >))+"
        "|$AV(exp_msgs)$INEST(<div,</div)</div >"
        ")"
        "|style=$AV(margin : -5px 0 5px)$INEST(<div,</div)</div >"
        ")"
        "|"
        "<(div|p|li)\2 class="
        "$AV(g)("
        "((^ style=$AV(margin-(left|right)*))($TST(a=odd)$SET(a=even)|$SET(a=odd))|)$SET(#=$GET(a))"
        ")(*<a)\#"
        "(*( href=$AV(/interstitial\?url\=h\9|([^/]+//[^/]+/)\9?*|*))\5*</a >)\4\6( <br>|( <table)\7)"
        "($TST(\9=t$SET(0="
        "<a href="h\9"><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-bug.png""
        " width=16 height=10 border=0 title="Malware warning!"></a>&nbsp;&nbsp;"
        ")*|$SET(0="
        "<a href="\9"><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-top.png""
        " width=10 height=10 border=0 title="Go to top domain"></a>&nbsp;&nbsp;"
        ")*)|)"
        "$SET(1="
        "<\2 class=g&#x20;\#\#\4&nbsp;&nbsp;\0"
        "<a\5 target=_blank><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-new.png""
        " width=14 height=10 border=0 title="Open in new window"></a>&nbsp;&nbsp;"
        "\6<br class=mainspace><br class=mainspace>\7"
        ")"
        "|"
        "<hr size=1 align=left color=#c9d7f1 width=65%>$SET(1=<hr size=1 align=left color=#c9d7f1 width=100%>)"
Replace = "\1"

The new additions are the last two lines in the matching expression, a simple match/replace. I checked in the US and Canadian versions of Google, and the code is exactly the same.


RE: [Kye-U] Google Alternate Display... - sidki3003 - Feb. 08, 2009 07:53 PM

When doing ProxRocks' example search, the first result right below that 3/4 line is for me:

Quote:Results for: showimage.htm
#
International Business Times - Article Archives [Go to top domain] [Open in new window] [Go to top domain] [Open in new window]

The little images, inserted right to that link, are duplicated.
That happens only with that first link. But for all "Did you mean" searches i've just tried.

If that's hard to reproduce, or problematic to fix, surely no biggie! Smile!


RE: [Kye-U] Google Alternate Display... - Kye-U - Feb. 08, 2009 08:19 PM

Fixed, although I don't really know the reason why "<p" was also being matched.

What I changed was (div|p|li) to (div|li).

The reason for the duplicate images is because of:

Code:
<li><p class=g style="margin-top:0"><span class=med>Results for:&nbsp;<b>showimage.htm</b></span>

Note the "<p class=g". Wink This updated filter also seems to prevent the "Results for: showimage.htm" being included in the alternating row colours system.

Code:
[Patterns]
Name = "Google Search: Alternate Display     9.01.30 (multi) [sd] (d.s) ku-20090208b"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)www.google.[^:/]+/(intl/[^/]+/(^?)|search\?(^q\=cache:)|webhp|(^?))$SET(keyword=$TST(keyword=\1.(i_layout:[#*:0].)+\2)\1.i_layout:2.\2)"
Limit = 2048
Match = "(^?)$SET(a=)$SET(b=)$STOP()"
        "|"
        "<br>((\r|)\n$SET(1= )| <br>( <table)\2$SET(1=</p><br class=mainspace>\2))"
        "|"
        "<("
        "/b> of (about )+<b>[0-9,]+</b> ((from|over the) $NEST(<b>,</b >) )+for <b>( <b>)+[^<]+"
        "&&((<*>|?)+{95})\2???$SET(1=<\2...\3\4\5)*|$SET(1=<\2\3\4\5)\2"
        ")(*</table > )\3(<div(^ id=)$INEST(<div,>)$SET(5=<div)|)$SET(4=<div id="topspace">&nbsp;</div>\r\n)"
        "|"
        "<style(^$TST(b=s))$SET(b=s)$SET(1="
        "<script>"
        "var prxSpics=["http://local.ptron/sidki_h_$GET(cfg)/Google/google-","
        "new Image(),new Image(),new Image()];"
        "prxSpics[1].src=prxSpics[0]+"bug.png";prxSpics[2].src=prxSpics[0]+"top.png";"
        "prxSpics[3].src=prxSpics[0]+"new.png";"
        "</script>"
        "<style id="themed""
        ")"
        "|"
        "<div ("
        "id=("
        "$AV(ie6tb)>$INEST(<div,</div)</div >( $NEST(<script,</script >))+"
        "|$AV(exp_msgs)$INEST(<div,</div)</div >"
        ")"
        "|style=$AV(margin : -5px 0 5px)$INEST(<div,</div)</div >"
        ")"
        "|"
        "<(div|li)\2 class="
        "$AV(g)("
        "((^ style=$AV(margin-(left|right)*))($TST(a=odd)$SET(a=even)|$SET(a=odd))|)$SET(#=$GET(a))"
        ")(*<a)\#"
        "(*( href=$AV(/interstitial\?url\=h\9|([^/]+//[^/]+/)\9?*|*))\5*</a >)\4\6( <br>|( <table)\7)"
        "($TST(\9=t$SET(0="
        "<a href="h\9"><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-bug.png""
        " width=16 height=10 border=0 title="Malware warning!"></a>&nbsp;&nbsp;"
        ")*|$SET(0="
        "<a href="\9"><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-top.png""
        " width=10 height=10 border=0 title="Go to top domain"></a>&nbsp;&nbsp;"
        ")*)|)"
        "$SET(1="
        "<\2 class=g&#x20;\#\#\4&nbsp;&nbsp;\0"
        "<a\5 target=_blank><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-new.png""
        " width=14 height=10 border=0 title="Open in new window"></a>&nbsp;&nbsp;"
        "\6<br class=mainspace><br class=mainspace>\7"
        ")"
        "|"
        "<hr size=1 align=left color=#c9d7f1 width=65%>$SET(1=<hr size=1 align=left color=#c9d7f1 width=100%>)"
Replace = "\1"



RE: [Kye-U] Google Alternate Display... - sidki3003 - Feb. 08, 2009 08:45 PM

Thanks, also for the code explanations!

Google used <p> tags, before introducing <li>. Probably it isn't used anymore now.
Regarding <hr>'s, in case they change something to the exact code, maybe a candidate for the CSS?

Old:
Code:
/* Content snippets */
.j { width: 100%; }

New:
Code:
/* Content snippets, horizontal rules*/
.j, hr { width: 100%; }



RE: [Kye-U] Google Alternate Display... - Kye-U - Feb. 08, 2009 08:49 PM

(Feb. 08, 2009 08:45 PM)sidki3003 Wrote:  Google used <p> tags, before introducing <li>. Probably it isn't used anymore now.

Ah, that makes sense Eyes Closed Smile

(Feb. 08, 2009 08:45 PM)sidki3003 Wrote:  Regarding <hr>'s, in case they change something to the exact code, maybe a candidate for the CSS?

Old:
Code:
/* Content snippets */
.j { width: 100%; }

New:
Code:
/* Content snippets, horizontal rules*/
.j, hr { width: 100%; }

That's a better solution! Thanks Smile! I guess you can remove the two last lines in the last filter I posted and update the CSS file.


RE: [Kye-U] Google Alternate Display... - sidki3003 - Feb. 08, 2009 08:57 PM

Good, i'll update filter and CSS accordingly.


RE: [Kye-U] Google Alternate Display... - whenever - Feb. 09, 2009 01:39 AM

If you are logged in:

The alternating row color system doesn't work, only the second result of the 'top 2 results shown' is shaded.

The [Go to top domain] [Open in new window] links are not added.


RE: [Kye-U] Google Alternate Display... - sidki3003 - Feb. 09, 2009 01:57 AM

$AV(g) -> $AV(g(\s*|))
?


RE: [Kye-U] Google Alternate Display... - Kye-U - Feb. 09, 2009 02:34 AM

whenever, it works fine for me when I'm logged in. I'm guessing you have a different version of Google? Can you copy/paste the unfiltered source code and attach it here?

Thanks!


RE: [Kye-U] Google Alternate Display... - whenever - Feb. 09, 2009 03:04 AM

(Feb. 09, 2009 01:57 AM)sidki3003 Wrote:  $AV(g) -> $AV(g(\s*|))
This brings the alternating row color and the [Go to top domain] [Open in new window] links back.

Attached you can find the source code.


RE: [Kye-U] Google Alternate Display... - sidki3003 - Feb. 10, 2009 07:03 PM

It's time to get to a "final" filter version. Smile!

I assume that i can add suggested change. (It *could* potentially break layout, because it doesn't write back the original secondary classes - those that follow "g".)


RE: [Kye-U] Google Alternate Display... - Kye-U - Feb. 10, 2009 07:59 PM

No reported page layout breakage here so far Wink


RE: [Kye-U] Google Alternate Display... - whenever - Feb. 11, 2009 02:25 AM

Is this supposed to be like that?
[attachment=299]


RE: [Kye-U] Google Alternate Display... - sidki3003 - Feb. 11, 2009 05:43 PM

Yep