DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Last post Author Topic: DONE: Have list of URLs, and, in Chrome, manually load one, then next, etc.  (Read 85,375 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Say we have a list of 100 URLs, and want to load these one at a time in Chrome.  Not in different tabs, but in the same tab.  Suppose that only one tab is needed, and only one tab will then be open.

I'd like to manually move through these URLs, spending as much time as I want on the opened page, then clicking or pressing a button and moving on to the next page.

Preferably the pages already visited can be deleted from the list, at some point.

Preferably the list can be saved, and brought up again, so that progress can be continued with the remaining URLs.

Preferably one can have more than one such list.

Thanks for suggestions, or possibly a program.

Nicholas Kormanik

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
neat idea.

It would be pretty easy to make a browser-neutral version that just had a list of urls, where you clicked on to move it to a "Done" list and it opened the url in the default or specified folder.

The only limitation is that it probably wouldn't be able to close the existing tab for you, so you'd have to do that manually.



I like the idea of a browser neutral tool.  There are some fun things you could do with this too, including keeping track of the date that each url was viewed, and maybe some notes associated with it..
« Last Edit: March 12, 2013, 09:08 AM by mouser »

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
There is an add-in that does roughly the same in Firefox, called Flem.  But at present I prefer using Chrome.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 11,205
    • Participated in NANY Challenge Fourteen Times
    • Coding Snacks
    • Writer
    • Hardware Hacker
There is an add-in that does roughly the same in Firefox, called Flem.  But at present I prefer using Chrome.

Have you tried contacting the add-in author?  Sometimes they're open to porting it; they just might not initially see the need.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Here's a basic AHK example that seems to work in Firefox, IE, and Chrome.  Run it, focus your browser, and use Ctrl+Right and Ctrl+Left to cycle through the list.  Of course, change the URL list to suit.

Code: (autohotkey)
myURLs =
(
http://www.donationcoder.com
http://www.filehippo.com
http://www.arstechnica.com
)


StringSplit, myURLsArray, myURLs, `n


^Right::
{
    myCounter++
    % ( myCounter > myURLsArray0 ) ? ( myCounter := 1 ) : ()
    URL_GoTo( myCounter )
}
Return


^Left::
{
    myCounter--
    % ( myCounter < 1 ) ? ( myCounter := myURLsArray0 ) : ()
    URL_GoTo( myCounter )    
}
Return


URL_GoTo( _URLnum )
{
    myURL := "myURLsArray" . _URLnum
    SendInput, ^l
    Sleep, 300
    SendInput, % %myURL%
    Sleep, 750
    SendInput, {ENTER}
}
« Last Edit: March 16, 2013, 12:51 PM by skwire »

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Many people have asked that Flem be ported to Chrome.  For some reason the authors of Flem decided not to.

Thanks, Skwire, for the AHK script!

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Thanks, Skwire, for the AHK script!

You're welcome.  Is that script good enough for your purposes?  If so, I'll mark this thread as done.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Unless anyone has anything else to add, mark as done.

Thanks again, Skwire.  You sure come through.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
I'd like to leave it open -- and see if anyone wants to make a real GUI utility for this -- that will let you save your url list, keep track of visited links, let you click to visit a link, etc.

I think it's a good candidate for a nice coding snack for an amature coder.

TaoPhoenix

  • 0 - 60 ... then back to 0 again!
  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • Participated in NANY Challenge Three Times
Here's a basic AHK example that seems to work in Firefox, IE, and Chrome.  Run it, focus your browser, and use Ctrl+Right and Ctrl+Left to cycle through the list.  Of course, change the URL list to suit.
...

On a random note, I'm kinda amazed that sending info to a browser is as simple as "send input". (Is THAT where it goes, to a BROWSER!?) I would have thought it would be way harder.
Use attachthumb=# to show an attached image as an expandable thumbnail, or attach=# to show full size. (With Brackets)

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
No, it's not like what you think.  In fact, it's rather inelegant.  Here's a commented snippet that should explain things:

Code: (autohotkey)
myURL := "myURLsArray" . _URLnum ; Dereference the variable.
SendInput, ^l                    ; Send a Ctrl+L hotkey to focus the address bar.  Works for FF, IE, and Chrome.
SendInput, % %myURL%             ; Send the actual URL text.
Sleep, 750                       ; Small wait time to allow for long(er) URLs.
SendInput, {ENTER}               ; Send and Enter keystroke to load the page.

Make more sense now?  A hack, pretty much.   :-[

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Interesting.. but you could also just do a shell exec to open a url and it will open in default browser, OR simply invokle an explicit browser exe and pass the url to it on commandline.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Interesting.. but you could also just do a shell exec to open a url and it will open in default browser, OR simply invokle an explicit browser exe and pass the url to it on commandline.

Sure, but then you run the risk of multiple windows/tabs (something the OP didn't want).

TaoPhoenix

  • 0 - 60 ... then back to 0 again!
  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • Participated in NANY Challenge Three Times
No, it's not like what you think.  In fact, it's rather inelegant.  Here's a commented snippet that should explain things:
...
Make more sense now?  A hack, pretty much.  :-[

Yeah, I get it now. A big part of what I was missing was that Control-L even existed.

I was looking for some kind of "pass info to the app".

All hail hacks!  :)
Use attachthumb=# to show an attached image as an expandable thumbnail, or attach=# to show full size. (With Brackets)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
A big part of what I was missing was that Control-L even existed.
+1, I've been using Alt-D for that in all mentioned browsers since ages, but Ctrl-L seems like a decent alternative :)
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
I'd still like to see this marked as not DONE and moved back to pending, and see what other coding snack coders might come up with.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Skwire's solution worked fine with the example URLs he provided.

Unfortunately not so with my case:

myURLs =
(
https://plus.google.com/104262594301276893821
https://plus.google.com/104283716002131797428
https://plus.google.com/104309222535259801633
https://plus.google.com/104392019611590500945
https://plus.google.com/104410043740081757281
https://plus.google.com/104429427297929885544
https://plus.google.com/104479772621336105362
https://plus.google.com/104541959256591361052
https://plus.google.com/104575325257916010047
https://plus.google.com/104608435688900811644
https://plus.google.com/104612126840644619266
)
etc...

The URL box entry gets broken up.  Could be do to a number of things, like the additional search box on the webpage, or possibly a conflicting add-in loaded?

So, mission not quite accomplished.  Thanks mouser for keeping the thread active.

Possible enhancement requests, though, Squire, in case there's an easy solution to the above:

-- Allow a reference to a separate file that holds the URLs.  Such as, "c:\look at sites\url list.txt"  Instead of forcing user to edit the .ahk script file.

-- Allow for a longer list of URLs.  I got error messages that I had too many (when attempting a much longer list than that shown above).

-- Perhaps allow user to choose which key to use to go forward, for instance the insert key (though a nice addition, I don't care so much about being able to go backward).

Thanks.

« Last Edit: March 14, 2013, 12:53 AM by nkormanik »

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
All that you want is, basically, possible.  As mouser suggested, I've moved this back to "IDEA" stage so let's see if anybody wants to pick this up.

The URL box entry gets broken up.  Could be do to a number of things, like the additional search box on the webpage, or possibly a conflicting add-in loaded?

Try increasing the sleep time in the script.  It's currently set for 750 milliseconds.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Increased sleep to 5000, and still the same problem.

What generally happens is that the h gets chopped off at the beginning of URLs.

So only:  ttps://plus.google.com/104410043740081757281

And that, of course, doesn't go to the intended site.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
What generally happens is that the h gets chopped off at the beginning of URLs.
So only:  ttps://plus.google.com/104410043740081757281

Then try adding a small sleep after the ^l line, e.g.:

Code: (autohotkey)
    SendInput, ^l
    Sleep, 300
    SendInput, % %myURL%

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Have you changed anything else in the script? The backtick-n in the StringSplit line is leading in splitting the array up, but it didn't even get confused when I converted the file to unix-line-ends in stead of the default dos-line-ends.
Maybe there are hidden (backspace) characters in your script?
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Ath, are you asking ME?  I wouldn't change ANYTHING except what is suggested.

I'm kinda clueless regarding AutoHotkey.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Skwire, adding the extra sleep step did the magic.  I can attest we have a working solution here now.

Maybe someone can make a stand-alone tool.  But at least we have a way that works.  Thanks much, Skwire.


Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Ah, busy system, yeah, an extra delay helps a lot then. Great it got resolved.

I've been thinking about that gui, but I'm not quite fluent in AHK, so lets wait a little first :tellme:
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,772
    • Participated in NANY Challenge Three Times
    • Cody Award
    • Coding Snacks
    • Official Forum Clown
    • Volunteers/Staff
    • Writer
    • Hardware Hacker
    • DJ Badge - DJ
    • Linux User
Pretty self explanatory GUI app for this:

[attachurl=#]

Will add more features if needed.

Thanks to Renegade for providing me with a big hand on this.

Original address: https://www.donationcoder.com/forum/index.php?topic=34285.0