Correct link targets (site-specific, list-based)
|
Nov. 03, 2012, 04:35 PM
(This post was last modified: Nov. 03, 2012 06:31 PM by duebel13.)
Post: #1
|
|||
|
|||
Correct link targets (site-specific, list-based)
Hello,
for some hours I've been fighting with this new thingy: Code: Name = "Links: Correct Target (Site-specifc, HTML) [dbl]" Given initial list: Code: www.ebay.(de|com|co.uk)/[^\?]++/i.html $SET(href=/itm/) This will open the matched links in new tabs in eBay item lists and in this forums. I could also add $SET(target=_self) to any line to force page opening in same page. The filter also contains some code to force download links to not open in a new page. Questions that puzzle me / things I couldn't get to work: 1.) The initial idea was to use positional variables instead of global variables but I've actually given up on this. Basically, what I originally intended was using $SET(0= instead of $SET(href=, and $SET(1= instead of $SET(target= in the list. But positional variables always expanded to nothing, wether I was using \0 or $TST(\0). Any idea what I might be missing? 2.) I'd like to use matching in the href part of the lists. For example: Code: */forumdisplay.php $SET(href=*/(show|view)thread.php) But as soon as I do this, the filter will no longer match. I' really stuck and would appreciate any help. Thanks. |
|||
Nov. 03, 2012, 09:04 PM
Post: #2
|
|||
|
|||
RE: Correct link targets (site-specific, list-based)
duebel13 Wrote:1.) The initial idea was to use positional variables instead of global variables but I've actually given up on this. Basically, what I originally intended was using $SET(0= instead of $SET(href=, and $SET(1= instead of $SET(target= in the list. But positional variables always expanded to nothing, wether I was using \0 or $TST(\0). Any idea what I might be missing? I don't think positional variables created in the URL Match survive to be used later in the filter. Also browse http://sidki.proxfilter.net/prox/sidki-e...niques.txt duebel13 Wrote:2.) I'd like to use matching in the href part of the lists. Changes.txt Wrote:or also just... duebel13 Wrote:I' really stuck and would appreciate any help. Thanks. Using your current work, I suspect that where you have "$TST(href)" you will want to call a list or reference an array. For example, CorrectLinkTargets-S might look like Code: www.ebay.de/[^\?]++/i.html $SET(href=www.ebay.de/) and your filter might look like Code: Name = "Links: Correct Target (Site-specifc, HTML) [dbl]" An array (using @ to separate possible values) could look something like Code: www.ebay.de/[^\?]++/i.html $SET(href=@/itm/@) The expression to use the array (if possible), I will have to post later. I'd probably add something to the filter to clear the "href" variable when work is done. Also, I have not tested the filter and list... HTH Changes.txt in the Proxomitron's Docs folder or http://www.proxomitron.info/45/docs/Changes.txt |
|||
Nov. 03, 2012, 11:11 PM
(This post was last modified: Nov. 03, 2012 11:35 PM by duebel13.)
Post: #3
|
|||
|
|||
RE: Correct link targets (site-specific, list-based)
Thanks JJoe. Using , instead of @, this is the latest version of the filter:
Code: Name = "Links: Correct Target (Site-specifc, HTML) [dbl]" These are working list entries: Code: (www|encrypted).google.[^/:]+(:443|)/search\? $SET(href=http,) I guess this filter isn't one of the fastest and it still lacks regular expressions in the href match, but it offers some kind of flexibility in this version: - only characters up to (but not including) a question mark are used for the match so that session ids and other arguments are discarded before matching - everything between two commas must fully and exactly match - if the first literal after the equal sign has no leading comma, it will be treated as if it had an asterisk wildcard at the end, i.e. "http," stands for http* (any URL starting with http) - if the last literal has no trailing comma, it will be treated as if it had an asterisk wildcard at the beginning, i.e ",.php" stands for any URL ending with .php (or .php?var=value&...) The $TST(CType=xhtml) used here is special to M. Buerschgen's filter set, but I noted that sidki's has a similar notation. Thanks again. Regards and <Gn(8)> (it's 8 min. past midnight here...) |
|||
Nov. 04, 2012, 04:27 PM
Post: #4
|
|||
|
|||
RE: Correct link targets (site-specific, list-based)
duebel13 Wrote:I guess this filter isn't one of the fastest The posted filter is missing some quotes and maybe a parenthesis. It doesn't import. See "Blocklist Indexing (hashes)" at http://www.proxomitron.info/45/help/Bloc...ation.html , "Of course, it's better to be hashable.". Also, I see "[Ff]". The Proxomitron's match is case insensitive. duebel13 Wrote:and it still lacks regular expressions in the href match, $TST(variable) is literal. For "Remove: Specific Functions on sel. Sites", sidki choose to have the user add an entry to create an array. Code: ## block specific functions $SET(sUserFn=§MATCH1§MATCH2§) Code: Name = "Remove: Specific Functions on sel. Sites 09.07.04 [sd] (d.0)" duebel13 Wrote:Regards and <Gn(8)> (it's 8 min. past midnight here...) Not a problem. Have fun. |
|||
Nov. 04, 2012, 05:55 PM
(This post was last modified: Nov. 04, 2012 06:03 PM by duebel13.)
Post: #5
|
|||
|
|||
RE: Correct link targets (site-specific, list-based)
(Nov. 04, 2012 04:27 PM)JJoe Wrote: The posted filter is missing some quotes and maybe a parenthesis. It doesn't import. Hmm, try this one (active in my config so should work): Code: Name = "Links: Correct Target (site-specific, (X)HTML) [dbl]" If this still doesn't work for you then there's something wrong with this forum's code... Quote:See "Blocklist Indexing (hashes)" at http://www.proxomitron.info/45/help/Bloc...ation.html , "Of course, it's better to be hashable.". IMO this is overrated. But I have no figures and thus this is basically just belief. Quote:Also, I see "[Ff]". The Proxomitron's match is case insensitive. We're talking about URLs here, not HTML code. The host and domain part is case insensitive, but at least on Unix/Linux based servers, the path for sure is case sensitive... Quote:$TST(variable) is literal. ACK - learned this the hard way over the last couple of days... Quote:For "Remove: Specific Functions on sel. Sites", sidki choose to have the user add an entry to create an array. Actually I wrote my own functions to add and remove expressions, attributes, and values in scripts, styles, and text. Even some kind of Stylish4Prox... But, yes, I noted that sidki's filter set (which you are still maintaining if I don't missed anything) is a great source for high quality filters. It's a shame that both sidki and mb turned their back on Proxomitron filter development in 2010. Interest in Proxomitron dramatically dropped over the last couple of years. In the German forums, there is one (!) active user besides me and I wonder why I am still posting filters and list updates there... Anyway, as long as IPv4 is there, Proxomitron will be there, too - at least for me. There are three tools that I really need on every new pc that I install Windows on, and that are Total Commander, Proxomitron, and Firefox v3. So 2 out of 3 are already dead - do I have to mention that I "updated" to XP from Win2k early this year, lol? Regards |
|||
Nov. 04, 2012, 10:46 PM
Post: #6
|
|||
|
|||
RE: Correct link targets (site-specific, list-based)
duebel13 Wrote:Hmm, try this one (active in my config so should work): It does. The first needed closing quotes for line 10 and 15. Also had an unmatched parenthesis in line 9. duebel13 Wrote:IMO this is overrated. But I have no figures and thus this is basically just belief. We tested. The advantage increases with the size of the list. duebel13 Wrote:We're talking about URLs here, not HTML code. The host and domain part is case insensitive, but at least on Unix/Linux based servers, the path for sure is case sensitive... True but my Proxomitron's matching routine doesn't care. f will match f or F. Case is retained for the replacement, however. Testing Code: [Patterns] against fF yields **fF** duebel13 Wrote:It's a shame that both sidki and mb turned their back on Proxomitron filter development in 2010. Interest in Proxomitron dramatically dropped over the last couple of years. In the German forums, there is one (!) active user besides me and I wonder why I am still posting filters and list updates there... This all took too much for sidki to continue. At some point you must consider your needs. Considering his contributions, 'turned his back on' would sound harsh to me. I did not know about Michael. Did he make a farewell post? Seeing http://wayback.archive.org/web/*/http://...rox/Forum/ and remembering CastleCops, you might want to archive some posts. I appreciate Scott R. Lemmon's gift. I try to help others feel the same. |
|||
Nov. 05, 2012, 05:24 PM
Post: #7
|
|||
|
|||
RE: Correct link targets (site-specific, list-based)
(Nov. 04, 2012 10:46 PM)JJoe Wrote:duebel13 Wrote:We're talking about URLs here, not HTML code. The host and domain part is case insensitive, but at least on Unix/Linux based servers, the path for sure is case sensitive... OK, thanks. Good to know. Quote:I did not know about Michael. Did he make a farewell post? Kind of. Can you read German? http://www.buerschgens.de/Prox/Forum/vie...336#p24336 My translation of the first paragraph: "I'm still alive but I don't think that I will ever release a new version. Due to my job, I'm on the road quite often and don't even get managed to read this forums - not to mention to post." The last sentence translates to: "I don't have any time for community work at the moment." That's not a real farewell, I guess, but some kind of longer lasting "temporarily unavailable". Quote: Seeing http://wayback.archive.org/web/*/http://...rox/Forum/ and remembering CastleCops, you might want to archive some posts. What you mean - the pages could vanish forever? Quote:I appreciate Scott R. Lemmon's gift. But I never understood why his family don't release the source code to the public - this would immortalize him. Quote:I try to help others feel the same. I appreciate that - thanks, JJoe. |
|||
Nov. 05, 2012, 06:41 PM
(This post was last modified: Nov. 05, 2012 07:02 PM by JJoe.)
Post: #8
|
|||
|
|||
RE: Correct link targets (site-specific, list-based)
(Nov. 05, 2012 05:24 PM)duebel13 Wrote: Kind of. Can you read German? Many years ago "kind of". These days I struggle. (Nov. 05, 2012 05:24 PM)duebel13 Wrote:Quote: Seeing http://wayback.archive.org/web/*/http://...rox/Forum/ and remembering CastleCops, you might want to archive some posts. Yes. http://www.dslreports.com/forum/r2163033...ops-Closed (Nov. 05, 2012 05:24 PM)duebel13 Wrote:JJo Wrote:I try to help others feel the same. I suspect that this is also part of why you continue to post filters and list updates at Deutsches Proxomitron-Supportforum. Thank you |
|||
« Next Oldest | Next Newest »
|