Jump to content

Recommended Posts

i'm pretty sure cron jobs is basically where you put ads on your site and earn credit for it. has nothing to do with php.

 

Umm no. A cron job is a task that runs at a certain time(s) automatically which you specify and is specific to unix. It really does not have to do with PHP other than you can setup a cron job to run a php script on your server if you have a linux server.

 

The equivalent to this in Windows is Scheduled Tasks. Do some googling if you want to learn more on Cron jobs.

Hey,

 

thanks for the replies. I decided to go with file_get_contents. a cURL might be an overkill for this.

 

<?php

$gold = file_get_contents('http://www.sitek.com/');
preg_match('~<span id = "XAU_B">(.+?)</span>~is', $gold, $goldMatch);

foreach ($goldMatch as $gMatched)
  echo $gMatched;



?>

 

The problem is that the actual information between the span is that they are images and they dont show up when I load my script. The image dynamically changes on it's own. Is it possible that PHP can't handle images only strings?

<?php
$gold = file_get_contents('http://www.sitek.com/');
?>

 

sitek.com does not have <span anywhere inside of it's source. Thus your preg_match code would never execute right.

 

If sitek.com is the site you want to parse, what are you trying to get out of that site? If not please post the site you want to parse so we can further help you.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.