fetch_rss and cron jobs
-
I’m trying to execute a php with a cron job. That php should read some xml feed and write the contents to a file.
The code, the feed reading part, looks like this:
<?php include_once(ABSPATH.WPINC.'/rss.php'); $postCount = 0; $feed = fetch_rss('https://www.infovalutar.ro/bnr/rss'); $items = array_slice($feed->items,0, 30); ?> <?php if (!empty($items)) : ?> <?php foreach ($items as $item): ?> <li><p><span class="slider-item"><?php echo $item['title']; ?></span> <?php echo $item['description']; ?></p></li> <?php endforeach; ?> <?php endif; ?>
This works if inserted in page template. Once I try to execute it with a cron job I get in mail the following error:
Warning</b>: include_once(ABSPATHWPINC/rss.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in <b>/home/...
What’s wrong? Thanks in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘fetch_rss and cron jobs’ is closed to new replies.