AutoHotkey Community

It is currently May 27th, 2012, 1:17 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 233 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 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: September 22nd, 2008, 2:57 pm 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
small suggest.

replace
Code:
  ; Gather numeric response value
   RetValue := SubStr(RetValue,1,3)   


with
Code:
regexmatch(retValue,"\b(?<Value>\d\d\d)\b",ret)

_________________
Joyce Jamce


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2008, 5:01 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
Lixx9000 wrote:
Code:
sRequest := DllCall("WinINet\HttpSendRequestA", "uInt",hRequest,"Str",Headers, "uInt",Strlen(Headers), "Str",POSTData,"uInt",Strlen(POSTData))


using the above line will give you trouble when handling binary data which contain a zero.
the zero will cause AHK to calculate a wrong size, and this might corrupt the POSTdata.

To correct it, u might want to use RtlMoveMemory-DllCall, but you will have to manually calculate your offsets on where to place the Binarydata.

use it as this:
Code:
DllCall("RtlMoveMemory","uInt",&postDataBlock+Offset,"uInt",&binaryData,"uInt",binaryDataLength)


This will cause to insert the binary data
To setup the POSTdata Length correctly just use dummy entries as i demonstrated with using the ImageShack Uploader example.

It 1st creates a POSTdata block by using dummy Values (creates with VarSetCapacity(dummy,fileSize,32) - 32 is Ascii-Value of A_Space)

all these values are put together to just big block, its size gets calculated with StrLen (which works here, since we only handle ASCII values)

and after that the RtlMoveMemory inserts the binary data into the block

hope this helps ... btw why dont u just use the function itself instead of ripping out several dll calls?

greets
dR

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2008, 6:11 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
tank wrote:
ok so question
this is still a bit deep for me (understanding this well enuff to modify it)
I can use the heck out of it tho except below
but our workplace has a proxy server and i need to use NTLM
http://msdn.microsoft.com/en-us/library/aa383144(VS.85).aspx
im a bit lost when it comes to implementing this into the scripts so far
:( and well i dont seem to have the depth of knowledge to make anything even remotely workable from it

[ Moderator!: MSDN link fixed ]
thanks for the fix
Actually the more in the msdn i read i think i might even be pointed in the wrong direction
basically our proxy uses our Domain login information for the proxy user
In IE we arent prompted but when i use any winhttp function i get blank results
seems like im getting blocked at the proxy for instance
Code:
WININET_Init()
MsgBox % UrlGetContents("http://www.autohotkey.net")
WININET_UnInit()
return
fine at home work pc returns blank
and im able to view this site without restriction on work pc in IE
basically my question is this is there a way to send proxy username or pass with this or lerner's version of these functions

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2008, 8:30 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
tank wrote:
basically my question is this is there a way to send proxy username or pass with this or lerner's version of these functions


i researched a bit, and this is what i learned:

You need to inject a header into the datastream which looks like this:
Code:
header := "Proxy-Authorization: Basic " base64(username":"password)


Keep in mind that Basic Authetification is case sensitive.

username:password needs to be base64 encoded.

greets
dR

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2008, 8:48 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
sweet thanks
ill give it a try and let you know how ti works out

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2008, 9:08 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
this is where i found the information bout the header injection:

http://www.codeguru.com/forum/archive/index.php/t-59121.html

greets
dR

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2008, 12:26 pm 
Offline

Joined: July 17th, 2008, 9:46 am
Posts: 225
Hi DerRaphael:
Can you help me?
I want to get the link of a cover from http://www.cdcovers.cc/ , but I only have the name of the game!
i.e. I want to get the cover of Age Of Empires only with the name!
How?
Thx in advance!
Greets,
DHMH


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2008, 10:50 pm 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
DerRaphael this is amazing, those functions is exactly what i was needed :)

you rock! keep up the good job!

Twhyman

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Where is this function??
PostPosted: November 24th, 2008, 8:59 pm 
I'm confused...the examples all include #include httpQuery.ahk....
But where is this file?? I don't see any links for downloading it??


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 9:21 pm 
Offline

Joined: May 2nd, 2006, 11:16 pm
Posts: 800
Location: Greeley, CO
You're kidding, right?
Read the first post again (carefully).

[edit]
Well... That was rude... Sorry.
You're not seeing a download link because it's not a download.
It's the 6th block of Code in the first post (clearly labeled httpQuery 0.3.4).

_________________
Image
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2008, 4:42 am 
Offline

Joined: February 14th, 2007, 8:01 pm
Posts: 308
I have a ahk that work great, below. But compile it to exe, it fails to run, and tells me that acertain line doesn't contain a recognizable action: DllCall("RtlMoveMemory","uInt",Dest,"uInt",&buffer%A_Index%,"uInt",A_LoopField)
, Dest += A_LoopField


Anyone can figure this out?


Code:
ipquery:
;replaces wget
#noenv
html     := ""
URL      := "http://checkip.dyndns.org"
POSTData := ""

length := httpQuery(html,URL,POSTdata)
varSetCapacity(html,-1)

fileappend,..%html%`n,ipstring2.txt
msgbox,, %html%,%html%,10
;end of ipquery
   ExitApp
   
#include httpQuery.ahk

;end of dynquery


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2008, 5:01 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
hi i just checkd ur code and it works fine for me. you do have the latest autohotkey available (1.0.47.05) ? tested with 1.0.48 beta, too. works aswell.


this code was used (httpQuery is in my StandardLib so it gets autoincluded)
Code:
#noenv
length := httpQuery(html,"http://checkip.dyndns.org")
varSetCapacity(html,-1)

msgbox,, demo,%html%,10
   ExitApp


greets
dR

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2008, 7:00 pm 
Offline

Joined: February 14th, 2007, 8:01 pm
Posts: 308
It works for me fine, except when I compile it to exe, which wont run.

Did you compile to exe?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2008, 7:06 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
yes .... by using standard compiler
still working (my firewall asks for permission but that was excepted)

greets
dR

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2008, 8:09 pm 
Offline

Joined: February 14th, 2007, 8:01 pm
Posts: 308
Verified, a version update needed!

You indeed rock.

BUt I do think a wizzard is needed. Moreover, to clarify, I always do 1,2,3 steps. 1. Why needed and where. 2. Here is my block code to #include in in dir and your ahk at end(or begining) 3. Here are the block of code to edit.

This stuff is rather deep: reaching into wininet, html posts/queries/header, etc. All while some obcessed fool like me, wishes to cut 400k off exe. One half of my brain said, not worth it, the other half was looking at future power of such an ability.

Again, thanks, you and this whole community are so generous. It brings tears to my eyes.

Now, anyone found a similar trick to telnet? ( have an email check and cddb scrip that relies on controlsend to a telnet that takes me half second to hide, and sometimes I don't think the send works so well.) Never mind, keep your energies here.


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, 2, 3, 4, 5, 6, 7 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon and 13 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