AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

****Viewer

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
q335r49



Joined: 26 Oct 2005
Posts: 17

PostPosted: Wed Feb 06, 2008 8:53 am    Post subject: ****Viewer Reply with quote

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? Very Happy

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. ]
Back to top
View user's profile Send private message AIM Address
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Feb 06, 2008 4:42 pm    Post subject: Reply with quote

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.
_________________

Back to top
View user's profile Send private message Visit poster's website
q335r49



Joined: 26 Oct 2005
Posts: 17

PostPosted: Wed Feb 06, 2008 5:10 pm    Post subject: Reply with quote

goddamn, 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?
Very Happy

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.
Back to top
View user's profile Send private message AIM Address
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Feb 06, 2008 5:29 pm    Post subject: Reply with quote

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.
_________________

Back to top
View user's profile Send private message Visit poster's website
Moderator!
Guest





PostPosted: Wed Feb 06, 2008 5:29 pm    Post subject: Reply with quote

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? Very Happy


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.
Back to top
BoBoĻ
Guest





PostPosted: Wed Feb 06, 2008 6:31 pm    Post subject: Reply with quote

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...). Rolling Eyes
Back to top
ManaUser



Joined: 24 May 2007
Posts: 906

PostPosted: Wed Feb 06, 2008 8:13 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Wed Feb 06, 2008 8:37 pm    Post subject: Reply with quote

Whats Porn?
_________________
check out my site
www.eliteknifesquad.com
Back to top
View user's profile Send private message
q335r49



Joined: 26 Oct 2005
Posts: 17

PostPosted: Wed Feb 06, 2008 8:37 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
[VxE]



Joined: 07 Oct 2006
Posts: 1499

PostPosted: Thu Feb 07, 2008 1:46 am    Post subject: Reply with quote

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.
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
q335r49



Joined: 26 Oct 2005
Posts: 17

PostPosted: Thu Feb 07, 2008 12:42 pm    Post subject: Reply with quote

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. Cool
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group