mIRC Homepage
Posted By: colt45 Revert URL - 04/12/19 07:05 PM
I'm not sure if this is possible, but every now and then, someone has been posting links using TinyURL.

I'd like to convert that TinyURL back into the original link.

i.e.

<moviebot> The Lion King (Animation, Adventure, Drama) - https://tinyurl.com/t46gles - Official Site Link: https://tinyurl.com/y33vwqh9 - Blu-ray due out on or around 22nd Oct 2019

Auto convert to this

<moviebot> The Lion King (Animation, Adventure, Drama) - https://www.imdb.com/title/tt6105098 - Official Site Link: https://movies.disney.com/the-lion-king-2019 - Blu-ray due out on or around 22nd Oct 2019

The reason is, I just don't like the idea of having TinyURL - i.e. if they're down, dead link, or not a trust link which may lead to a spam site, etc.. - So I'd like all to be in original links.

Thanks
Posted By: Wims Re: Revert URL - 06/12/19 06:00 PM
You can use the following:

Code
//noop $urlget( https://tinyurl.com/t46gles ,gbi,&urlconv,tempecho)
with this alias:
Code
alias tempecho echo -s url: $urlget($1).redirect


This should work for most website as well.
Posted By: colt45 Re: Revert URL - 12/12/19 03:53 AM
Raking my head for a few days frown

I've tried Wims's code above but didn't turn out exactly how I wanted as it's giving me a different URL - seems that it grabs the 2nd links, not the 3rd link I need - sorry if I didn't mention it in the original post as I only just found out that it requires me to log in first, it's why I get that "login.php" first then onto the actual page.

Anyway, I've tried this (which I thought it might works)...

Code
alias test1 {
  /url https://tinyurl.com/t46gles
  //echo -a Test 1 URL : $url
  /set %link $url
  //echo -a Test 1 LINK : %link
}

alias test2 {
  /url https://tinyurl.com/t46gles
  //echo -a Test 2 URL : $url
  timer 1 2 /set %link $url
  timer 1 2 //echo -a Test 2 LINK : %link
}

Results comes out as :

Quote


In variable, I see https://tinyurl.com/t46gles but not the IMDb link.

After ran that script, I had that IMDb open with no issues and fast.. but still getting this https://tinyurl.com/t46gles as a final result but when I manually type it in any window to test myself i.e.

Code
//echo -a $url
- This shows up as https://www.imdb.com/title/tt6105098/ and that is exactly what I wanted.

It seems that I can't set a %link with the new link even if I have a timer for it. No matter what I do, still picks up or consider this https://tinyurl.com/t46gles every time frown

(By the way, TinyURL is only an example but I'm using a private site that I'm trying to get info from - that requires the 1st link to visit first, then it auto logs me in (2nd link), and then the 3rd link it shows up a link I need - so basically I just want to grab that "final" link which takes under a second to load the page.)
© mIRC Discussion Forums