Sign in to follow this  
Followers 0
TheWebz

Help inetget doesn't work!

29 posts in this topic

I made this code but the file doesn't show up in the script folder!

here is the code:

#include 
; Open needed handles
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
Global $hRequest = InetGet( "mp3skull.com/mp3/" & $zata & ".html", @ScriptDir )
InetClose( $hRequest )



; Display retrieved header
$r = FileRead( $zata & ".html" )
MsgBox( 64, "texto", "" & $r )
Beep( 700 )

Share this post


Link to post
Share on other sites



What's the return value and the value of @error after you called INetGet?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

You are mixing foreground and background download in your script.

InetGet is called to run in the foreground. InetClose is only needed when InetGet is run in the background.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I add the file name and took out inetclose but it still doesn't work!

look:

#include
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
Global $hRequest = InetGet( "mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )




; Display retrieved header
$r = FileRead( $zata & ".html" )
MsgBox( 64, "texto", "" & $r )
Beep( 700 )
Edited by FranciscoLeal

Share this post


Link to post
Share on other sites

Change this line:

;from this
Global $hRequest = InetGet( "mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
;to this

Global $hRequest = InetGet("http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html")

From the help file:

The URL parameter should be in the form "http://www.somesite.com/path/file.html" - just like an address you would type into your web browser


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Thanks for the help.

Autoit staff are very helpful!


Share this post


Link to post
Share on other sites

Ok i've improved a bit my code, but i can't find a way to display only the search results in the gui.

Code:

#include 
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
for $i = 0 to 100
Next
ProgressOn( "Searching..", "Working..", "Searching for " & $zolo & " ..." )
ProgressSet( 30 )
Global $hRequest = InetGet( "http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
ProgressSet( 100, "Done!" )
sleep(3000)
ProgressOff()


; Display retrieved header
Run( "ISTO.html" )
Beep( 700 )

Can anyone help me?


Share this post


Link to post
Share on other sites

TheWebz,

Try adding @scriptdir to your run command.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

I made this code. I build it in order to create a program wich will search for a music in a site and return the results.

#include 
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
for $i = 0 to 100
Next
ProgressOn( "Searching..", "Working..", "Searching for " & $zolo & " ..." )
ProgressSet( 30 )
Global $hRequest = InetGet( "http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
ProgressSet( 100, "Done!" )
sleep(3000)
ProgressOff()


; Display retrieved header
Run( @ScriptDir & "\ISTO.html" )
Beep( 700 )

I would like to know if it is possible and if someone can help me.


Share this post


Link to post
Share on other sites

Come on 6 users reading and no one knows?

Pls..


Share this post


Link to post
Share on other sites

jeez your impatient!

i'm going back to eating my lunch!

Share this post


Link to post
Share on other sites

Ok i'll wait..


Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

The Webz, please do not bump your posts without waiting at least 24 hours. This is not a 24-hour support forum; those of us who lend assistance do so because we enjoy the language and want to help. Remember, just because it is critical to you does not mean it is critical to everyone else :)

Edit: Also, you already have a thread going for this script Unless your request is wildly different, please stick to one thread at a time.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Ok i'm sorry, i just want some help.


Share this post


Link to post
Share on other sites

Ok i will explain better.

Here is the code that i've made:

#include 
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
for $i = 0 to 100
Next
ProgressOn( "Searching..", "Working..", "Searching for " & $zolo & " ..." )
ProgressSet( 30 )
Global $hRequest = InetGet( "http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
ProgressSet( 100, "Done!" )
sleep(3000)
ProgressOff()

I build it in order to create a program wich will search for a music in a site and return the results.

Can someone help me?


Share this post


Link to post
Share on other sites

TheWebz, you need to explain precisely what is not working for you, rather than asking us to guess :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Ok i am writting a program that will search for musics in this site http://www.mp3skull.com and it will return the results into a listbox.

I have already done the part where the user write the name of the music, the program create the link for the search but then how do i show the results in a listbox?


Share this post


Link to post
Share on other sites

I have merged the threads and would appreciate when you:

  • are patient
  • better describe what you need help with or what is not working
  • stick to one thread.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Jos i already stick to this thread, i am waiting, i expose my problem, so instead of blaming me you could help me or at least try to.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0