topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 3:13 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA Drop Zone javascript link extractor and launcher  (Read 7164 times)

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
IDEA Drop Zone javascript link extractor and launcher
« on: March 23, 2021, 04:51 PM »
Preferably in AHK so I can learn a little

I use Ancestry...

  In the past it would provide a search result list with links. You could right click the ones of interest into a new tab, or window. They have recently moved to javascript. which only allows you to open one choice in the current window. a right pain as it slows down everything you do !

First  a drop zone is needed where I can drag the javascript link.

On mouseover the status bars shows. 
javascript:SetCfpId(102049804500)

The variable we need is the bit between the brackets. In this example.
102049804500

The util will need a place for the user to store the "URL string" the javascript variable gets appended to.

example of "URL string"
https://www.ancestry.co.uk/family-tree/tree/12345678/family/familyview?cfpid=
On dropping the link, the real URL is assembled
eg
https://www.ancestry.co.uk/family-tree/tree/12345678/family/familyview?cfpid=102049804500

The resulting URL should ideally be launched in a new tab on the source browser window, or a new window.

Using Chrome.

TIA
John
Why an I Magician62? Because Magician1 thru 61 were gone. :)

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #1 on: March 23, 2021, 05:05 PM »
I would think a UserScript would be a better option, have the links replaced directly in the page.

BTW, just tried a search on Ancestry and it comes back with full links here, (wife uses Ancestry all the time via the local library portal).
« Last Edit: March 23, 2021, 06:28 PM by 4wd »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #2 on: March 24, 2021, 05:06 AM »
The links I refer to are those provided when in "tree view" and you do a "tree search".

Screenshot_20210324_03_11-Family View - Ancestry.com.jpg
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #3 on: March 24, 2021, 05:16 AM »
The resulting URL should ideally be launched in a new tab on the source browser window, or a new window.

Using Chrome.

TIA
John

Hi John, sure thing! Give me a day or two to complete this "Drop Launcher" project  :Thmbsup:

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: April 11, 2021, 02:47 PM by publicdomain »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #4 on: March 24, 2021, 05:53 AM »
Many thanks for the reply Vic.

I am noticing more and more each day, websites making things "harder"/"slower". I wonder how much is to make it mobile compatible. Not that anyone would have several screens open at the same time on multiple monitors. :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #5 on: March 25, 2021, 06:39 PM »
Many thanks for the reply Vic.

My pleasure! :)

Quick question before uploading first alpha as per your requirements. Is this Chrome-only?
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: March 25, 2021, 06:45 PM by publicdomain »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #6 on: March 30, 2021, 02:05 AM »
Sorry for the slow reply, days have just disappeared of late.

Yes, Chrome only. I rarely use Firefox, never Edge. and only use IE if nothing else works. :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #7 on: April 07, 2021, 10:39 PM »
Yes, Chrome only.

Hello John! This alpha release should do exactly what you want for the ancestry site :)

DropLauncher_v0-1-0.png

Please download & test (Updated to v0.1.0): https://github.com/p.../releases/tag/v0.1.0

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: April 11, 2021, 03:50 PM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #8 on: April 09, 2021, 05:38 PM »
(A more-generic version is in the making with regular expressions for adapting it to any site)
-publicdomain (April 07, 2021, 10:39 PM)

It's published! :)

Drop Launcher thread: https://www.donation...ex.php?topic=51294.0

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #9 on: April 11, 2021, 04:49 AM »
Sorry I have been absent for a few days, though it seems like years. :) Will take a look later when I return. :) I hadn't realised how long it has been since I last checked my emails!
Why an I Magician62? Because Magician1 thru 61 were gone. :)

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #10 on: April 11, 2021, 10:44 AM »
I think I am am going to have to try again in the morning. I downloaded, but nothing appeared to happen. I edited the tree URL. It indicated it had launched after a drop, but nothing seen.

I also found another ancestry Feature. If you use the tree search from a persons profile, it still provides a real link. It's great they code for consistency, NOT! :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #11 on: April 11, 2021, 03:37 PM »
I think I am am going to have to try again in the morning. I downloaded, but nothing appeared to happen.

Please try with latest version (v0.1.0) at: https://github.com/p.../releases/tag/v0.1.0

Thanks!
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #12 on: April 11, 2021, 04:20 PM »

Please try with latest version (v0.1.0) at: https://github.com/p.../releases/tag/v0.1.0

Thanks!
-publicdomain (April 11, 2021, 03:37 PM)


No noticeable difference. Still counts number launched, but nothing appears.

Is there a way to tweak it so it just outputs what I have dragged and what it is proposing to do?

I did try editing the settings to make LaunchRegex the same as resulting page, the theory was no matter what was dropped it would execute a valid result. That didn't do anything either, but then I was guessing. :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #13 on: April 11, 2021, 06:52 PM »
No noticeable difference. Still counts number launched, but nothing appears.

Is there a way to tweak it so it just outputs what I have dragged and what it is proposing to do?

There may be no need for such a "debug tweak" :)

Please retry with this fixed version (v0.1.1): https://github.com/p.../releases/tag/v0.1.1

Many thanks for your test & report :-*

User input is magical! It makes software work as it should  :Thmbsup:

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #14 on: April 12, 2021, 11:44 AM »
Please retry with this fixed version (v0.1.1): https://github.com/p.../releases/tag/v0.1.1
-publicdomain (April 11, 2021, 06:52 PM)

Tested on Windows 10 using Google Chrome. Matches regex & launches.

https://github.com/p.../releases/tag/v0.1.1
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #15 on: April 13, 2021, 01:29 PM »
It works It works. Many thanks indeed.
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #16 on: April 13, 2021, 10:00 PM »
It works It works. Many thanks indeed.

So glad you liked it :)

Preferably in AHK so I can learn a little

You may learn the Regular Expression language for .NET to expand the program's matching & launching: https://docs.microso...uage-quick-reference

Cheers & I'm very happy to assist :Thmbsup:

Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com