AutoHotkey Community

It is currently May 27th, 2012, 5:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 233 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 16  Next

Should a more generic function be released which will include the already available web functions, such as header queries, uri encoding, base encoding, etc ?
yes, i'd like to have one function to get all neccessary http functionalities in one instead of collecting each for my own
no, i prefer collecting the functions i need
neither nor ... explained in post
You may select 1 option

View results
Author Message
 Post subject:
PostPosted: April 17th, 2010, 7:44 am 
Offline

Joined: April 11th, 2010, 10:24 am
Posts: 23
Desi you can use Autohotkey.dll, HotkeyIt has an Ansi Version that will run the httpquery function without problems and with threads support


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2010, 9:44 pm 
Any way to make this work with AHK_L? (Latest httpQuery Version, tested with Downloader Example)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2010, 7:24 am 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
here, Lexikos and HotKeyIt introduced the neccessary modifications to have a version capable of working in virtually any ahk build.

http://www.autohotkey.com/forum/viewtop ... 068#347068

dR

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject: http header missing
PostPosted: April 25th, 2010, 3:01 pm 
Offline

Joined: April 11th, 2010, 10:24 am
Posts: 23
Hello buddy I check the code below on Windows XP and 7. The httheader is missing...

Code:
#noenv
Gui, Add, Button, x0 y0 w100 h40 gbtnStart, Start Now!
Gui,Show
Return


btnStart:
      fbLogin()
         
fbLogin(){
   HTTPQueryOps := "storeHeader"
   length := HttpQuery(raw, "http://www.google.com")
   varSetCapacity(raw,-1)
   ;FileAppend, %html%.`n, %A_ScriptDir%\facebook.txt
   MsgBox % HttpQueryHeader
}
#Include, httpQuery.ahk


The last message box is empty... If I remove the function works perfect. Do you have any idea of what's happening? I try with google and facebook and the same error.

Thanks for your suggestions


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2010, 6:50 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Because function is not global it does not work:
Code:
;...
fbLogin(){
   global
   HTTPQueryOps := "storeHeader"
;...

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: thanks buddy!
PostPosted: April 25th, 2010, 6:51 pm 
Offline

Joined: April 11th, 2010, 10:24 am
Posts: 23
thanks buddy :P


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 18th, 2010, 10:18 am 
I'm looking to download a file from an FTP Server (with a progress bar) and then delete the file once the download has completed.

Can anyone help me with this ?

Thanks

tovlesk


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2010, 11:52 pm 
Offline

Joined: August 25th, 2007, 9:25 pm
Posts: 110
Code:
   ; Get any missing default Values
   defaultOps =
   (LTrim Join|
      httpAgent=AutoHotkeyScript|httpProxy=0|httpProxyByPass=0|INTERNET_FLAG_SECURE=0x00800000
      SECURITY_FLAG_IGNORE_UNKNOWN_CA=0x00000100|SECURITY_FLAG_IGNORE_CERT_CN_INVALID=0x00001000
      SECURITY_FLAG_IGNORE_CERT_DATE_INVALID=0x00002000|SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE=0x00000200
      INTERNET_OPEN_TYPE_PROXY=3|INTERNET_OPEN_TYPE_DIRECT=1|INTERNET_SERVICE_HTTP=3
   )

At a user's of my scripts computer does this code does not work.
I have to use
Code:
   ; Get any missing default Values
   defaultOps =
   (LTrim Join|
      httpAgent=AutoHotkeyScript|httpProxy=0|httpProxyByPass=0|INTERNET_FLAG_SECURE=0x00800000
      SECURITY_FLAG_IGNORE_UNKNOWN_CA=0x00000100|SECURITY_FLAG_IGNORE_CERT_CN_INVALID=0x00001000
      SECURITY_FLAG_IGNORE_CERT_DATE_INVALID=0x00002000|SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE=0x00000200
      INTERNET_OPEN_TYPE_PROXY=3|INTERNET_OPEN_TYPE_DIRECT=0|INTERNET_SERVICE_HTTP=3
   )
then it does.

With UrlDownloadToFile it does work very well, but I don't want to get these temporary files :)

Why must I change this option? I've searched a bit on google and found out, that there are four values for the "dwAccessType" in "InternetOpen":
    INTERNET_OPEN_TYPE_DIRECT: Resolves all host names locally.
    INTERNET_OPEN_TYPE_PRECONFIG: Retrieves the proxy or direct configuration from the registry.
    INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY: Retrieves the proxy or direct configuration from the registry and prevents the use of a startup Microsoft JScript or Internet Setup (INS) file.
    INTERNET_OPEN_TYPE_PROXY: Passes requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy. In this case, the function uses INTERNET_OPEN_TYPE_DIRECT.

So httpQuery passes a number from 0 to 3 to the DllCall in InternetOpenA.
Why does it only work with number 0?

PS: He uses a proxy, which is because he has an umts surf stick.

Greetings, flashkid


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 27th, 2010, 5:14 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
by defining INTERNET_OPEN_TYPE_DIRECT := 0 you actually re-define the connection initialisation to use a preconfigured (eg from registry) setup.

Code:
; snippet from http://www.digitalmars.com/d/archives/digitalmars/D/14913.html

# static DWORD INTERNET_OPEN_TYPE_PRECONFIG                    = 0;
# static DWORD INTERNET_OPEN_TYPE_DIRECT                       = 1;
# static DWORD INTERNET_OPEN_TYPE_PROXY                        = 3;
# static DWORD INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY  = 4;


by the time i wrote the script, it appeared to me as a good idea to "force" a direct connection or to manually set a proxy, and to avoid the default windows settings. a computer might get infected by a malicious piece of software and therefor the internal setup of how to connect to the net might become corrupted. some worms and virii actually do that either to either redirect the target user to a 3rd party website or to avoid updating or downloading anti virus software. this could also be used to spy passwords / login credentials and then redirect the user to the actual target page

so if a proxy is used it should be named explicitly for httpQuery.

i assume that UrlDownloadToFile uses the default setup from windows in any case (eg INTERNET_OPEN_TYPE_PRECONFIG), this might be an idea why it's working.

greets
derRaphael

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 27th, 2010, 5:22 pm 
Offline

Joined: August 25th, 2007, 9:25 pm
Posts: 110
Thanks for your fast reply :)

What would you recommend me? I don't know the users proxy configurations, so I should set Internet_Open_Type to preconfig, shouldn't I?
Must I change it in the header of the function or can I declare it from outside like user agent?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2010, 12:46 pm 
Hey!

First of all, thanks for this great function, I use it every day, and it's been working great.
But I've been experiencing a small inconvenience since I've started using the function:

My CPU load gets really high for a few (5-10) seconds, I can't even stop AHK until after the function completed.
I wonder if anyone experienced anything like this?

The problem occurs when calling HttpSendRequestA:

Code:
sRequest := DllCall("WinINet\HttpSendRequestA"
                  , "uInt",hRequest,"Str","", "uInt",0
                  , "Str","","uInt",0)


And right after the dllcall finished, the CPU usage falls back to normal.

I don't really know if this is OS/wininet version-specific but I'd really like to solve this, it's bugging the hell out of me.

Here are the specifications of the environment in which I experience the problem:
httpQuery version:
0.3.4
0.3.5

Win version:
Microsoft Windows XP Professional
5.1.2600 Service Pack 2 build 2600

CPU:
x86 Family 15 Model 2 Stepping 7 GenuineIntel ~2205 Mhz

Wininet:
wininet.dll
7.0.6000.20696
806 kB
C:\WINDOWS\system32
Microsoft Corporation

Cheers
gahks


Report this post
Top
  
Reply with quote  
 Post subject: Help!
PostPosted: June 15th, 2010, 11:31 pm 
Offline

Joined: March 16th, 2008, 6:48 pm
Posts: 161
Location: Brooklyn
I hate to do this, but I need help. I've read through the entire thread several times & I've searched everywhere for a working example of this, but I can't find it.

Whenever I run it, I do get it to download information but it's not any different from what URLDownloadToFile would give me. Even with the authentication filled in. Is there a tutorial or a place to start?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2010, 6:16 am 
Offline
User avatar

Joined: May 10th, 2007, 10:54 am
Posts: 649
Location: .switzerland
On the initial Page are some Examples - also there are Examples how to login, save the cookie and hold the session. Search this Thread ;)

Otherwise, post your code, and we may fix it.

_________________
http://securityvision.ch
AHK 2D GAME ENGINE


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 20th, 2010, 12:20 am 
Offline

Joined: March 16th, 2008, 6:48 pm
Posts: 161
Location: Brooklyn
IsNull wrote:
Otherwise, post your code, and we may fix it.

It wasn't for lack of effort, but I am still stuck... I did use an example from the main page. I changed the Postdata as suggested in Page 2. It does return some data, however it does not accept the authentication. So rather than displaying an e-mail address, it says "EMAIL: Show Email".

Any thoughts on what I might be doing wrong?

Code:
username = "My Login name here"
password  = "My Password here"
#noenv
html     := ""
URL      := "http://www.exporters.sg/member_profile.asp?co_id=7090"
POSTData := "username=" . username . "password=" . password
length := httpQuery(html,URL,POSTdata)
varSetCapacity(html,-1)

Gui,Add,Edit,w800 +Wrap r25,% html
Gui,Show

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 20th, 2010, 12:34 am 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
without checking for cookies the page requires more than just username and password, since u cannot know which variables are actually evaluated on serverside you'd need to send all available variables from the given login form. also i guess that cookies will be used so you'll need a cookie function aswell

take a closer look at the source lines from 196 to 251 at source:http://www.exporters.sg/members/memberlogin_form.asp?referer=/membersdir.asp?

also i'd advise you to use install httpFox for firefox and trace the login procedure. this will reveal all neccessary data including cookies.

greets
dR

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 233 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Stigg and 9 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