Post Reply 
one more filter to clean link
Jun. 12, 2007, 11:40 AM
Post: #1
one more filter to clean link
a small iFrame on a news site opens this piece of code and I wanted to filter out the s65.hhh.cn and open the link directly from http://www.readthis.cn

code:

<div id="JL_up">
<h1><a href="http://s65.hhh.cn/phpAdsNew/adclick.php?bannerid=291&amp;dest=http://www.readthis.cn/news/domestic/news.asp?id=1383826" target="_blank">The news items in question</a></h1>
<!-- <p><a href="http://s65.hhh.cn/phpAdsNew/adclick.php?bannerid=291&dest=http://www.readthis.cn/news/domestic/news.asp?id=1383826" target="_blank"> <i class="dtPublishBrief">(12.06. 12:56)</i></a></p> -->
<p><img src="triang.png" height="7" width="10"><a href="http://s65.hhh.cn/phpAdsNew/adclick.php?bannerid=291&amp;dest=http://www.readthis.cn/news/domestic/news.asp?id=1383826" class="read" target="_blank">read</a></p>
</div>

I tried (did not work):

replace
<a\1href=$AV(http://*.hhh.cn/phpAdsNew/adclick.php?bannerid=[0-9]\&dest=\2)\3>

with
<a\1href="$UESC(\2)"\3>
Add Thank You Quote this message in a reply
Jun. 12, 2007, 11:46 AM
Post: #2
RE: one more filter to clean link
in case it is important, the code that shows up in the iFrame comes from this short include on every page and is embedded inside a small table of the iFrame called thenewsitem_lift

<div class="contentNewsItem">
<iframe name="thenewsitem_lift" id="newsitem_lift" src="http://www.readthis.cn/rss/headers/" width="468" height="225" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible;"></iframe>
</div>
<div class="dividerHor"></div>
Add Thank You Quote this message in a reply
Jun. 12, 2007, 03:43 PM
Post: #3
RE: one more filter to clean link
susa Wrote:I tried (did not work):

replace
<a\1href=$AV(http://*.hhh.cn/phpAdsNew/adclick.php?bannerid=[0-9]\&dest=\2)\3>
[0-9] is one number 0-9.
You have more numbers to match. So [0-9]+
Code:
[Patterns]
Name = "New HTML filter"
Active = FALSE
Limit = 256
Match = "<a\1href=$AV(http://*.hhh.cn/phpAdsNew/adclick.php?bannerid=[0-9]+\&dest=\2)\3>"
Replace = "<a\1href="$UESC(\2)"\3>"
Add Thank You Quote this message in a reply
Jun. 12, 2007, 05:56 PM
Post: #4
RE: one more filter to clean link
argh.

doesn't work...

here's one such link and it's inside an rss feed iFrame which the news site page loads into the main news page

<a href="http://s65.dada.cn/phpAdsNew/adclick.php?bannerid=291&amp;dest=http://www.read.cn/newz/home/newz.asp?id=1384118" target="_blank">
Add Thank You Quote this message in a reply
Jun. 12, 2007, 06:25 PM
Post: #5
RE: one more filter to clean link
susa Wrote:<a href="http://s65.dada.cn/phpAdsNew/adclick.php?bannerid=291&amp;dest=http://www.read.cn/newz/home/newz.asp?id=1384118" target="_blank">
Ahh. I missed seeing that &amp; before. So they don't always use it.
Wait... the host has changed to dada.cn.
Code:
[Patterns]
Name = "New HTML filter"
Active = FALSE
Bounds = "<a\s*>"
Limit = 256
Match = "\1href=$AV(http://[^/]+/phpAdsNew/adclick.php?bannerid=[0-9]+\&(amp;|)dest=\2)\3"
Replace = "\1href="$UESC(\2)"\3"
This seems to match all the examples posted. Smile!

susa Wrote:it's inside an rss feed iFrame
Is the Proxomitron seeing the code that it's expected to change?
Add Thank You Quote this message in a reply
Jun. 12, 2007, 07:38 PM
Post: #6
RE: one more filter to clean link
if not (and JJoe's already aware of this [the filter idea came from him]), this is what i use to get Proxo to filter my RSS feeds:
Code:
[HTTP headers]
In = TRUE
Out = FALSE
Key = "Content-Type: 6d Filter XML {JJoe} (In) [add]"
Match = "(text/xml)\1$FILTER(true)"
Replace = "\1"

edit: edited to add [HTTP headers], sorry 'bout that...
Add Thank You Quote this message in a reply
Jun. 12, 2007, 08:12 PM
Post: #7
RE: one more filter to clean link
pr - is that a http header or pattern ?
Add Thank You Quote this message in a reply
Jun. 12, 2007, 08:14 PM
Post: #8
RE: one more filter to clean link
jjoe - apparently proxo is not seeing the code as I hover mouse over the links and nothing is changed
Add Thank You Quote this message in a reply
Jun. 12, 2007, 08:48 PM
Post: #9
RE: one more filter to clean link
susa Wrote:pr - is that a http header or pattern ?
It's a header filter. Only header filters have the "Key" field.
The easiest way to add it is to
copy it to the clipboard
Open the Header filters dialog
Click (once) a filter
Right-click and select import.
Click OK or Apply

Same idea works for Web page filters.

When you want to share, select export and then paste the filter from the clipboard.

susa Wrote:jjoe - apparently proxo is not seeing the code as I hover mouse over the links and nothing is changed
It's possible that another filter is matching and hiding the code.
I see "target="_blank"" in all the examples. Do you have a filter that adds "target="_blank""?

If the links are in a RSS feed,
the Proxomitron has to be told to filter these.
That's what the Content-Type filter ProxFox posted does.

If you give me an address, I'll look and see, if I can.
Add Thank You Quote this message in a reply
Jun. 12, 2007, 09:14 PM
Post: #10
RE: one more filter to clean link
http://www.hs.fi/ulkomaat/artikkeli/1135227970576
Add Thank You Quote this message in a reply
Jun. 12, 2007, 10:33 PM
Post: #11
RE: one more filter to clean link
susa Wrote:http://www.hs.fi/ulkomaat/artikkeli/1135227970576
Silly me. I was expecting Chinese. lol

On that page, I find a small frame that calls
http://www.iltasanomat.fi/rss/uutisotsikot/

It contains code like
Code:
<a href="http://s65.sanoma.fi/phpAdsNew/adclick.php?bannerid=291&dest=http://www.iltasanomat.fi/viihde/uutinen.asp?id=1384149" target="_blank">

Which is changed to
Code:
<a href="http://www.iltasanomat.fi/viihde/uutinen.asp?id=1384149" target="_blank">
by the filter I posted.

Are we looking at the same thing?
Did you import the filter, enable it, and click OK?
Also, clear the browser's cache.
Add Thank You Quote this message in a reply
Jun. 13, 2007, 01:15 AM
Post: #12
RE: one more filter to clean link
yes, same thing, does not work for me

I did setup the header filter

must be something else undoing the link as I see only the unchanged link when I hover mouse over it
Add Thank You Quote this message in a reply
Jun. 13, 2007, 01:54 AM
Post: #13
RE: one more filter to clean link
susa Wrote:yes, same thing, does not work for me
Open the Proxomitron's Log Window.
Right-click and enable "HTML Debug info"
Then open http://www.iltasanomat.fi/rss/uutisotsikot/

Upload a copy of the debug page and the Log Window and I'll see if I can see what's going on. A zip file would be best.
Which filter set are you using?
Have you tried the filter in another set?

susa Wrote:I did setup the header filter
I don't think you need the header filter. This isn't xml.
Add Thank You Quote this message in a reply
Jun. 13, 2007, 03:53 AM
Post: #14
RE: one more filter to clean link
filter set is jd_extra.cfg with some small changes

attached is the log


Attached File(s)
.rar  log.rar (Size: 1.04 KB / Downloads: 604)
Add Thank You Quote this message in a reply
Jun. 13, 2007, 12:02 PM
Post: #15
RE: one more filter to clean link
oddly enough, when I test the filter as posted above, in proxo, the link is correctly changed in the Test dialog to

Code:
<a href="http://www.iltasanomat.fi/viihde/uutinen.asp?id=1384149" target="_blank">

but in actual use, it is not, so something else must be preventing it
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: