Script Request - URL Cleanser.

Discuss and share scripts and script files...
Post Reply
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Script Request - URL Cleanser.

Post by SkyFrontier »

Can someone please help me building this?

This:

Code: Select all

http://us.lrd.yahoo.com/_ylc=X3oDMTJkMXBsaTczBF9TAzM5ODMzNjk2NwRnc3RhdGUDMwRwb3MDMwRzZWMDbndfdG9wc3RvcmllcwRzbGsDdGl0bGUEdGFyA2NhLm5ld3MueWFob28uY29t/SIG=154hfgagv/**http%3A//ca.rd.yahoo.com/dailynews/rss/20100721-obama_signs_sweeping/**http%3A//ca.news.yahoo.com/s/reuters/100721/n_top_news/cnews_us_financial_regulation_obama
should output like this:

Code: Select all

http://ca.news.yahoo.com/s/reuters/100721/n_top_news/cnews_us_financial_regulation_obama
-some of the source links have a single asterisk as indicator of the target link:

Code: Select all

...obama_signs_sweeping/*http%3A//ca.news.yahoo.com/s/reuters/100721/n_top_news/cnews_us_financial_regulation_obama
-the links are stored on a series of .txt files, so each selected file should produce a fixed, cleaned clone file with a proper identifier (whatever, something like "_CLEANurl".

-such links are listed with separators, and they should be reproduced in the clone files - or at least changed by something under the similar role of a separator.
or
must output at least with
http://ca.news.yahoo.com1
==================
http://ca.news.yahoo.com2
==================
Thanks in advance!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Script Request - URL Cleanser.

Post by SkyFrontier »

I've got it.
The following code will read clipboard and clean (with a very impressive accuracy, but not 100% reliable - failed with a link listed below*, not bad if you consider that's one out of 283 links...) Yahoo News URLs (the ones you get with Yahoo Mail/main page).
Thanks for the regEx, Sue!

Code: Select all

   $a = <clipboard>;
   status "Please wait: retrieving info...", BF0000, progress;
   $a = regexreplace($a, ":.*%[\da-f]+", "");
   $a = regexreplace($a, "http", "http:");
   copytext $a; text $a;
   status "Info ready in clipboard, too!";
Later I'll add an offline conversion support.

*Failed with (for obvious reasons):

Code: Select all

http://br.yahoo.com/_ylt=AiRi4eKlMj6sjvzaYOGhkCDK7q5_;_ylc=X3oDMTlkdmh1YTYyBF9TAzIxNDIxNzA4MjYEYQMwNjE2X2NvcGFfdnV2dXplbGF6b191cn
VndWFpbwRjY29kZQN5cmQEY3BvcwMzBGcDaWQtMTA0MzMEaW50bANicgRpdGMDMARsdHh
0A09zaWzDqm5jaW9kYXN2dXZ1emVsYXMEcGtndgM1BHBvcwMwBHNlYwN0ZC1mZWF0BHNsa
wN0aHVtYmxpbmsEc2xwb3MDRgR0YXIDaHR0cCUzQSUyRiUyRmcuYnIuZXNwb3J0ZXMueWFo
b28uY29tJTJGZnV0ZWJvbCUyRmNvcGElMkZibG9nJTJGZG9tYXVybyUyRnBvc3QlMkZPLXZ1dn
V6ZWxhem8tdXJ1Z3VhaW8lM0Z1cm4lM0RmYmludGwlMkMyNDg5ODIEdGVzdAM3MDc-/SIG=1
3c77f3pl/**
http%3A//g.br.esportes.yahoo.com/futebol/copa/blog/domauro/post/O-vuvuzelazo-uruguaio%3Furn=fbintl,248982
(splitted the URL to not screw the post.)
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply