Ask a Question related to PHP Development, Design and Development.
-
Steven Wüthrich #1
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
-
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... -
Grabbing All Cookies
You should be able to get only the cookies for the domain in which your script is running. ... -
[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... -
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... -
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... -
Ninjaboy #2
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



Reply With Quote

