Closed Thread
Results 1 to 4 of 4

Thread: Price Finding...

  1. #1
    hodge-podge is offline Learning Programmer
    Join Date
    Jun 2009
    Location
    New Hampshire.
    Posts
    47
    Rep Power
    0

    Price Finding...

    Finally 10 posts....On with the question...

    I am writing a script that searches ebay and amazon for the product number of a product (of course), finds only the price and returns the price. Pretty simple, however, I am just beginning perl and I need a bit of help...

    Here is the script so far....

    Code:
    use LWP;
    use LWP 5.64;
    use URI;
    LWP::Simple
    
    my $browser = LWP::UserAgent->new;
    
    $prod = <>;
    my $url = URI->new( 'http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Dtools&field-keywords=$prod;' );
    $url->query_form{
    'product number' => <>;
    }
    
    my $response = $browser->get( $url );
    First of all, how would I have the program determine the price of the product? Possibly look for the info that had been declared "price" in the css? ...and thats about it. Help, and a definite answer maybe...(>.> <.<) would be greatly appreciated.

    Thanks.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    hodge-podge is offline Learning Programmer
    Join Date
    Jun 2009
    Location
    New Hampshire.
    Posts
    47
    Rep Power
    0

    Re: Price Finding...

    Wow, the Perl forum doesn't get much attention...Anyone want to help me out?

  4. #3
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0

    Re: Price Finding...

    You posted on two of the slowest perlk forums on the internet, I answered on the other
    one :

    Price Finding....

    (Its not much help though)

    I suggest you post on tek-tips or devshed or perlmonks (not all of them at the same time) if you really want help. This forum and tizag are very slow as far as perl goes.

  5. #4
    DigitalLinx's Avatar
    DigitalLinx is offline Newbie
    Join Date
    Aug 2009
    Posts
    12
    Rep Power
    0

    Re: Price Finding...

    I guess you wish to make something like this
    Code:
    use warnings;
    use strict;
    use LWP::UserAgent;
    
    my $ua = LWP::UserAgent->new();
    
    die usage() if !$ARGV[0];
    
    my $res = $ua->get('hxxp://www[dot]amazon[dot]com/s/ref=nb_ss_gw?url=search-alias%3Dtools&field-keywords='.$ARGV[0]); # edit can't post links
    my @price =  $res->content =~ m/(\$\d+)/gs;
    foreach(@price) {
            print "$_\n";
    }
    #print $res->content;
    sub usage {
            print "Usage perl $0 product\n";
    }

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting product price from data feed
    By sharataka in forum Community Projects
    Replies: 0
    Last Post: 03-15-2011, 06:05 AM
  2. RequiredFieldValidator price range
    By Dumpen in forum ASP, ASP.NET and Coldfusion
    Replies: 4
    Last Post: 04-02-2010, 06:49 AM
  3. The Price is Right
    By Logan in forum The Lounge
    Replies: 12
    Last Post: 12-05-2008, 05:19 PM
  4. Displaying stock price
    By Minti in forum JavaScript and CSS
    Replies: 3
    Last Post: 05-14-2008, 03:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts