AutoHotkey Community

It is currently May 27th, 2012, 10:43 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: ****Viewer
PostPosted: February 6th, 2008, 9:53 am 
Offline

Joined: October 26th, 2005, 5:11 pm
Posts: 28
OK, so, you know how **** sites have websites like:

www.****.com/gallery01.htm
www.****.com/gallery02.htm

etc.?

Here is a script to save you some time, and hence, increase efficiency!
1) An input box with the current contents of the clipboard pops up
2) Put vertical separators ("|") around the field to increment, e.g.:
www.****.com/gallery|01|.htm
3) Check whether it is padded or not ("09" "10" or "9" "10")
4) Every time you hit Ctrl-V, the script will paste the next entry.
5) Ctrl-Shift-V will paste the previous entry
5) Win-Q to quit.
Good script or great script? :D

Code:
#NoEnv
SendMode Input

File := MyInputBox(Clipboard)
Return

^v::
File := NextFile(File,1,GL_UsePadding)
StringReplace, TempString,File, |,,A
Send, %TempString%
Return

^+v::
File := NextFile(File,-1,GL_UsePadding)
StringReplace, TempString,File, |,,A
Send, %TempString%
Return

#q::
ExitApp

NextFile(Filepattern, increment=1, Padding=1)
{
   StringSplit, Temp, FilePattern, |
   If Temp0 = 3
   {
      If Padding
      {
         Len := StrLen(Temp2)
         Temp2 += increment
         Padding := Len-StrLen(Temp2)
         Loop %Padding%
            Pad = %Pad%0
      }
      else
      {
         Temp2 += increment
      }
      ReturnString = %Temp1%|%Pad%%Temp2%|%Temp3%
      Return ReturnString
   }   
   else
      Return ERROR
   
}


MyInputBox(InitialText)
{
   global GL_InputText
   global GL_UsePadding
   gui, -caption +LastFound +AlwaysOnTop +ToolWindow
   gui, add, edit, vGL_InputText, %InitialText%
   Gui, Add, Button, Default, OK
   Gui, Add, Checkbox, vGL_UsePadding Checked, Padding
   gui, show
   InputBoxActive = 1
   Loop
   {
      Sleep, 500
      If InputBoxActive = 0
         Break
   }
   Return %GL_InputText%

   ButtonOK:
   Gui, submit
   GuiEscape:
   InputBoxActive = 0
   Return
}



[ Moderator!: The links / title have been masked. ]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 5:42 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
It looks like another moderator cencored your post, I hope you undertand why.

I recenly found a Firefox extension called PicLens which is a really amazing image viewer that works on nearly evey website, even those without a defined image naming structure. It's always useful to have an AutoHotkey script that can download images, so thanks for sharing.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 6:10 pm 
Offline

Joined: October 26th, 2005, 5:11 pm
Posts: 28
the word "p*rn" is not itself p*rn. And p*rn.com is not a real site. It's like how I can talk about racism without being offensive. In short, censorship is absolutely ridiculous... are we in the Victorian era or what?
:D

Then again, I'm no martyr -- I just like to point out stupidity when it arises. So, carry on as always, and all this is spoke with somewhat condescending good humor.

Btw, I'm starting to run out of ideas as what to do with this autohotkey program... like, little things that can be automated are hard to find, if you don't play a lot of video games.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 6:29 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
I don't like cencorship either, and if it's for educational purposes I see no reason to make things unnecessarily complicated. Perhaps a moderator decided that 'porn' could have attracted negative attention in the form of further spam and flame posts. If you want you could adapt your code to behave as a generic image downloader.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 6:29 pm 
q335r49 wrote:
And p*rn.com is not a real site.


the link worked.

Quote:
censorship is absolutely ridiculous... are we in the Victorian era or what? :D


no offense meant .. we are in a forum where a 10 year old ahk`ite posts regularly.
i wanted to delete the topic, but saw that the script was good and also your joined date counted.

thanks for understanding.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 7:31 pm 
Quote:
If you want you could adapt your code to behave as a generic image downloader.
I've stated that several month/years ago (I guess at the German Autohotkey Forum) - to download trippleX-images without reviewing each and everyone of it in advance, could end up in a delicate communication with your local police authorities.
Because once you 'grep' images (even by mistake) which could be interpreted afterwards within the context of pedophilia - well, then you will get really f... (and I mean the definitley unpleasant type of being f...). :roll:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 9:13 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Hopefully one knows in advance whether the site they're visiting would contain that sort of content. Of course it isn't technically possible to "review" an image before downloading it anyway. Any time an image appears in your browser it has already been downloaded, and in all likelihood it has been saved on your hard drive since most browsers are configured to cache images to the disk.

But enough of that, back to the original script. I have a few suggestions. How about some "sanity checking". The first time I ran the script I had a large amount of text in the clipboard (the script itself, in fact) and it popped up oversized messagebox that was a little hard to close. Also ^v is the standard shortcut for paste, so it might be better not to use that for this script. On a more positive note, I suggest this improvement:
Code:
Send, !d%TempString%{Enter}

In most browsers* Alt+D will highlight the address bar so this will automatically send the new URL to the address bad and then press enter so the browser goes there immediately.

You also could use a variation of that method to extract the current URL, to save having to manually copy it.

*Except Opera, where it's Alt+A, IIRC. But Opera has something kind of like this built in so you probably wouldn't use this script with Opera anyway.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 9:37 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
Whats Porn?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2008, 9:37 pm 
Offline

Joined: October 26th, 2005, 5:11 pm
Posts: 28
Aaaa, the philosophy of autohotkey, and amateur scripting in general. Autohotkey scripts are so simple that most scripts are basically a "proof of concepts" where you are obviously free to tweak to your heart's content, so my intention is always to make the code as general and simple as possible.

The word general is interesting -- somebody said a generic image downloader. Some bash scripts could do that pretty easily, generate a huge list, but autohotkey goes in a different direction, it doesn't emphasize data patterns so much as gestures and patterns in user input. So, the word "general" leads us in two different directions -- either towards being generalized to a certain data type or to a certain set of gestures ... and I'm always thinking about the latter, in autohotkey. The idea is to be aware of your key presses and mouse gestures rather than the abstract data types you are working with. So, a generic image downloader would be, suprisingly, quite different from what is intended.

This is what I mean when I say that I am running out of ideas... there is a limit to the superificial ways in which computers and people interact. Autohotkey is always thinking about, you know, resizing windows, arranging things, etc. Sort of like Microsoft's Surface Computing -- that is what makes it distinct from, say, Java or other more general languages. What is the most efficient way to represent elements and to manipulate them -- this is the question of Autohotkey.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2008, 2:46 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
q335r49 wrote:
there is a limit to the superificial ways in which computers and people interact.

I recommend that you take a class on "Human-Computer Interaction" at a reputable institution of higher learning before you make such a claim.

As for your script... the concept looks interesting. Certainly a number of people could benefit from an easy way to access incrementally-named URL's. It may help to use URLDownloadToFile as a binary test to see whether the incremented URL is valid or not, since some series of webpages (for example, business reports, which may be named/ordered by date) may be ordered but not sequential.

About the language thing... it is true that words themselves are never as vulgar as the context in which they are usually uttered, but these forums are supposed to be friendly even to young children. But more importantly, some browsers allow word-based language filters to block websites if they detect improper language.

So, if I made a post with the words "***", "****", "*******", "***", "***", "****", "*******", "***", "****", "*******", "****", "***", and "politics", a school computer's browser might stop little johnny-5th grader from downloading his class project off these forums.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2008, 1:42 pm 
Offline

Joined: October 26th, 2005, 5:11 pm
Posts: 28
I recommend you start thinking and presenting some arguments rather than, in a rather condescending way, attempting some sort of pedagogical moment, pointing others to outside references and catching on to a single sentence without attempting to understand the intention. This is a forum after all, and arguments are key. And people are often suprised at the amount of education certain members have at what reputable institutions, when they are not innocent 10 year olds.

Again, what you say is perfectly fine, there are about a million reasons for and against, and it basically comes down to who has the last word. What if, for example, an 18 year old was doing a research paper on philosophies of porn in message board culture? I mean, we can go hog wild here. 8)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group