Jump to content
Sign in to follow this  
hodgepodge

Product Search

Recommended Posts

hodgepodge

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

Share this post


Link to post
Share on other sites
Yashied
hodgepodge

You lost a part of the code.

:D

Haha, no I just haven't bothered "finishing" it without figuring out how to proceed.

How does the code look so far, and.. any answer to the question of discerning the price?

Share this post


Link to post
Share on other sites
Yashied

Share this post


Link to post
Share on other sites
hodgepodge

Well, do you have, any help to offer?

...

Share this post


Link to post
Share on other sites
Zisly

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

Share this post


Link to post
Share on other sites
Yashied

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?

Share this post


Link to post
Share on other sites
hodgepodge

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.