Jump to content

Product Search


Recommended Posts

Alright, so this is my first attempt at a complete, functional script in any language (except JS, HTML, etc...)...

So I am running into a few problems...

What I am trying to accomplish is a program that will allow me to enter product codes into a list, then, when I press a search button the script will look on two specified sites and return the price of the product alone.

First of all I am lost as to how you incorporate internet functions into the script, however, this seems like it would be simple enough, I just need some guidance.

The major obstacle I think I will be facing will be isolating the price of the product alone on the web page and returning that value to a table. Is there any function that could accomplish it? Would I have to parse the page itself?

Finally could you please also critique my script, just learning...Thanks..

#include<GUIConstantsEX.au3>
#include<IE.au3>
#include<WindowsConstants.au3>
#include<Constants.au3>

Opt("GUIOnEventMode", 1)
Opt("GUICloseOnESC", 0)

$s_1 = 'upcdatabase.com/item/'
$s_2 = 'http://www.amazon.com/s/ref=nb_ss_hi?url=node%3D468240%2C328182011&field-keywords='
$s_3 = 'http://www.google.com/products?q='

;Main GUI 
;Array is for the product codes
;Array two is for the prices
Local $array[], $array2[], $list, $add, $msg, $search, $in
GUICreate( "Product Search")
$search = GUICtrlCreateButton("Search!", 5, 7) ; fix all the alignment later
$add = GUICtrlCreateButton("Add", 2, 5)
$list = GUICtrlCreateList("Items to search for", 3, 3)
$in = GUICtrlCreateInput("" , 3, 1)

$in = $array [1 to 20] ;no idea if this is right

;create search function and add function

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $search
        ;place search function here
    Case $msg = $add
        GUICtrlSetData($list, $in)
Edited by hodgepodge
Link to comment
Share on other sites

Link to comment
Share on other sites

If you use GUIOnEventMode you can't use GUIGetMsg().

So either use GUIOnEventMode or GUIGetMsg().

If you want the gui to show you need to add guisetstate(@sw_show)..

Like this;

GUICreate( "Product Search")
$search = GUICtrlCreateButton("Search!", 5, 7); fix all the alignment later
$add = GUICtrlCreateButton("Add", 2, 5)
$list = GUICtrlCreateList("Items to search for", 3, 3)
$in = GUICtrlCreateInput("" , 3, 1)
GUISetState(@SW_SHOW)

And what where you trying to do with $array [1 to 20]?

Edited by Zisly
Link to comment
Share on other sites

Alright, so this is my first attempt at a complete, functional script in any language (except JS, HTML, etc...)...

So I am running into a few problems...

What I am trying to accomplish is a program that will allow me to enter product codes into a list, then, when I press a search button the script will look on two specified sites and return the price of the product alone.

First of all I am lost as to how you incorporate internet functions into the script, however, this seems like it would be simple enough, I just need some guidance.

The major obstacle I think I will be facing will be isolating the price of the product alone on the web page and returning that value to a table. Is there any function that could accomplish it? Would I have to parse the page itself?

Finally could you please also critique my script, just learning...Thanks..

Where are you taking this script?
Link to comment
Share on other sites

If you use GUIOnEventMode you can't use GUIGetMsg().

So either use GUIOnEventMode or GUIGetMsg().

If you want the gui to show you need to add guisetstate(@sw_show)..

Like this;

GUICreate( "Product Search")
$search = GUICtrlCreateButton("Search!", 5, 7); fix all the alignment later
$add = GUICtrlCreateButton("Add", 2, 5)
$list = GUICtrlCreateList("Items to search for", 3, 3)
$in = GUICtrlCreateInput("" , 3, 1)
GUISetState(@SW_SHOW)

And what where you trying to do with $array [1 to 20]?

Oh, alright...

And about the array...Well, I want to store whatever I input into that array so I can recall the values later into the program. Im almost certain that that isn't the way to do it however... >.> <.<

Oh, also, how do I link the input form with a button using the GUIset method, the help file only shows how I would do that with the msg method...

Thanks

Edited by hodgepodge
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...