I'm new and something isnt working for me

Discussion in 'Neopets Chit-Chat' started by banana, May 6, 2007.

Thread Status:
Not open for further replies.
  1. banana

    banana Newbie

    Joined:
    May 6, 2007
    Messages:
    35
    Likes Received:
    0
    So I decided to try out the basic refresher just to start. Hopefully I will get some good RE's with it. I downloaded it, but when i tried to use it, it said I couldn't or something.

    Any suggestions on what is wrong?

    Also I apologize if this is the wrong board for it. Like i said, im new to this.
     
  2. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    Nope if it gives you the runtime error 13 type mismatch then it will not work. The httpwrapper that is uses will not work anymore so it is broken permatly
     
  3. banana

    banana Newbie

    Joined:
    May 6, 2007
    Messages:
    35
    Likes Received:
    0
    ok i have no idea what you just said. :shock:
     
  4. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    its borken and does not work
     
  5. banana

    banana Newbie

    Joined:
    May 6, 2007
    Messages:
    35
    Likes Received:
    0
    ok well i bought a new one. this one downloaded, and when i clicked on it, this box of text popped up. Now what do i do? :shock:
     
  6. brknwing2007

    brknwing2007 Level I

    Joined:
    May 5, 2007
    Messages:
    135
    Likes Received:
    0
    Location:
    Usa, Florida
    Prob like what was said, it is broken and you may as well go to the help forum for suggestions or maybe just get something else. Hope this helps.
     
  7. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    what did it say
     
  8. banana

    banana Newbie

    Joined:
    May 6, 2007
    Messages:
    35
    Likes Received:
    0
    it said this:

    #!/usr/local/bin/perl
    use LWP;
    use HTTP::Cookies;

    #Author Karl S.
    #Date 28/9/2006
    #Information Neopets Refresher

    #Initiate global objects
    my $baseurl = "http://neopets.com"; #Neopets base URL
    my $spiderurl = "/explore.phtml"; #Neopets base URL
    my $waittime = 1; #Wait time
    my $regexmatch = qr#href=\"(/.*?\.phtml)\"#; #Compile the regex and store it - allows for faster execution later on
    my $regexlogin = qr/Welcome, /; #Compile the regex and store it - allows for faster execution later on
    my $regexloginerr = qr/That\s*<.*>\s*<.*>\s*(.*)\s*<.*>\s*<.*>\s*combination is invalid\./; #Compile the regex and store it - allows for faster execution later on
    my $ua = LWP::UserAgent->new; #Build the ua obj
    $ua->env_proxy(); #Check for a proxy running on your system/network
    $ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7"); #Set the useragent to the default Firefox ua
    $ua->cookie_jar(HTTP::Cookies->new); #Use cookies
    push @{$ua->requests_redirectable}, 'POST'; #Allow POST requests to be redirected by the server(for login)


    #Ask for username & password on terminal
    quit("Usage: $0 <username> <password> <macrotimeinsecs>") if $#ARGV < 2 or $ARGV[2] =~ /\D+/;
    my ($username, $password, $waittime) = @ARGV;

    &test;
    login($username, $password);
    spider($spiderurl);


    sub test{
    my $url = "www.google.com";
    my $req = HTTP::Request->new(GET => $url);
    $req->referer("http://www.google.com");
    }


    sub login {
    my $username = shift;
    my $password = shift;
    my $loginurl = $baseurl . "/login.phtml";

    print "Logging in with <" . $username . "> and <*******> ... ";

    my $post = $ua->post($loginurl,
    [
    "username" => $username,
    "password" => $password
    ],
    );

    if($post->is_success){
    if($post->content =~ $regexlogin){
    print "Logged in!\r\n";
    }else{
    print "Could not log in: $1 invalid\r\n" if $post->content =~ $regexloginerr;
    exit;
    }
    }else{
    die "Error: ", $post->status_line;
    }
    }

    sub spider {
    my $startpage = shift;
    print "Going to: $startpage\n";
    my $get = $ua->get($baseurl . $startpage);

    if($get->is_success){
    if(my @matches = $get->content =~ /$regexmatch/g){
    if($#matches >= 0){
    my $index = int(rand($#matches));

    if($matches[$index] =~ m{http://www\.neopets\.com/.*}){
    sleep $waittime;
    spider($spiderurl);
    }

    sleep $waittime;
    spider($matches[$index]);
    }else{
    sleep $waittime;
    spider($spiderurl);
    }
    }
    }

    }

    sub quit {
    my $msg = shift;
    print $msg;
    exit;
    }
     
  9. palepink

    palepink Level IV

    Joined:
    May 8, 2007
    Messages:
    883
    Likes Received:
    1
    Location:
    Bangkok, Thailand
    Aww, what if I buy a program and it doesn't work? will i get my points back? (sorry, i'm new to the site =)
     
Thread Status:
Not open for further replies.