Automated Info-grabbing from other sites

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Automated Info-grabbing from other sites

    Hi folks,

    I'm working on a project and am kind of stuck at the moment. After googling
    for a while now, my last hope to find an answer is this newsgroup, hopefully
    you can help me and point me to some helpful resources.

    Here is what I'm trying to do:

    I'd like to automatically run a cronjob once a day. The purpose of my script
    will be to connect to a website offering concert tickets and to return
    information about how many tickets of the predefined bands are still
    available.

    Here an example:
    Let's say we've got this site [url]www.jlajsdflj.com/band.html[/url]
    This site offers information about the band, the location where the concert
    will be played, how many tickets are still available and so on...

    My script will now connect to this site and extract the number of tickets
    available, return this and disconnect.


    Now, i'm totally stucked with this and have no clue at all how this could be
    done. I've already heared about some kind of HTTPNavigator that sort of
    simulates HTTP requests.
    I'd appreciate it very much if anyone of you could give me a hand with this
    one!

    thanks in advance and greets from switzerland,

    Steve


    Steven Wüthrich Guest

  2. Similar Questions and Discussions

    1. Need help grabbing info from asp dropdown list box
      Make sure your value is in quotes <option value="this that"> "Melissa" <mc1204@hotmail.com> wrote in message...
    2. Grabbing All Cookies
      You should be able to get only the cookies for the domain in which your script is running. ...
    3. [PHP] Grabbing info from other Sites
      assuming the login isn't necessary (which it probably is), you could use something like Snoopy (http://sourceforge.net/projects/snoopy/) to POST/GET...
    4. Two sites open at once so I can copy info between the two
      How do I have two sites open at once so I can copy text, pics etc from one to the other. I only need to copy certain bits not a whole page. Tried...
    5. Grabbing Info with PHP and cookies
      Hello, I am writing a php script that will grab information from another site, and the script should work well, but the site needs the user to...
  3. #2

    Default Re: Automated Info-grabbing from other sites

    or you can do it with php using curl for https pages here is a quick
    example

    $var = PostCurlPage("https://domain.com/index.php","searchtix=band");

    function GetCurlPage ($pageSpec) {

    $agent = "Mozila-C3";
    $header[] = "Accept: text/vnd.wap.wml,*.*";
    $ch = curl_init($pageSpec);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_VERBOSE, 1); ########### debug
    curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, "cook");
    curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");
    $tmp = curl_exec ($ch);
    curl_close ($ch);
    return $tmp;
    }
    function PostCurlPage ($pageSpec, $data) {

    $agent = "Mozila-C3";
    $header[] = "Accept: text/vnd.wap.wml,*.*";
    $ch = curl_init($pageSpec);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_VERBOSE, 1); ########### debug
    curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, "cook");
    curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

    $tmp = curl_exec ($ch);
    curl_close ($ch);
    return $tmp;
    }


    <Michael Vilain <vilain@spamcop.net>> wrote in message
    news:vilain-EE01CE.08465912102004@comcast.dca.giganews.com...
    > In article <ckgo9t$jav$1@newshispeed.ch>,
    > "Steven Wüthrich" <news@dsxs.net> wrote:
    >
    >> Hi folks,
    >>
    >> I'm working on a project and am kind of stuck at the moment. After
    >> googling
    >> for a while now, my last hope to find an answer is this newsgroup,
    >> hopefully
    >> you can help me and point me to some helpful resources.
    >>
    >> Here is what I'm trying to do:
    >>
    >> I'd like to automatically run a cronjob once a day. The purpose of my
    >> script
    >> will be to connect to a website offering concert tickets and to return
    >> information about how many tickets of the predefined bands are still
    >> available.
    >>
    >> Here an example:
    >> Let's say we've got this site [url]www.jlajsdflj.com/band.html[/url]
    >> This site offers information about the band, the location where the
    >> concert
    >> will be played, how many tickets are still available and so on...
    >>
    >> My script will now connect to this site and extract the number of tickets
    >> available, return this and disconnect.
    >>
    >>
    >> Now, i'm totally stucked with this and have no clue at all how this could
    >> be
    >> done. I've already heared about some kind of HTTPNavigator that sort of
    >> simulates HTTP requests.
    >> I'd appreciate it very much if anyone of you could give me a hand with
    >> this
    >> one!
    >>
    >> thanks in advance and greets from switzerland,
    >>
    >> Steve
    >
    > Perl does this very easily. There are extensive CPAN modules that gives
    > Perl this ability, plus the ability to do SSL connections. I'd look at
    > Perl instead of php for this application.
    >
    > --
    > DeeDee, don't press that button! DeeDee! NO! Dee...
    >
    >
    >
    >

    Ninjaboy Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139