Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Vandam500

macrumors 68000
Original poster
Sep 29, 2008
1,844
109
I've been looking for a other one since AP Mobiles appears to push news once or twice a week... It's pretty useless. Wondering if anybody out there has found something else? And what is taking the other news apps so long... Sigh.
 
I gave up on AP and switched to News Fuse. I'm actually happy with it even tho Push is not available with it. It's fast and most importantly I get to use MY full screen without Ads or Banners.

I was disappointed like others.
 
Sportstap pushes baseball scores, but I don't know about any other sports. You pick your team(s), and it pops up a message to let you know when the game is under way, when either team scores, and then at the end of the game. It's worked great for me, I can see what's happening with the Sox without even having to think about it. I didn't even have Sportstap on my iPhone, but I downloaded until Sportacular gets push ready to go.
 
Mmm, okay I see that I missed the part of that question that said 'news'. I guess baseball scores are technically news, but not the kind the original poster is after. Still, push on Sportstap works really well...
 
You can push any RSS feed you like to your iPhone using Prowl if you have access to a web server and don't mind getting your hands dirty.

1. Purchase Prowl from the app store and register for an account
2. Get the Prowl PHP class from - http://code.google.com/p/php-prowl/
3. Get SimplePie to handle RSS feeds from: http://simplepie.org/
4. Edit the below code to contain your user details and your feed(s) you want displayed
5. Upload class.prowl.php, simplepie.inc and whatever you call your cusotmized script (mine is facebook.php as I use it to push Facebook notifications)
6. Create a sub-directory cache in the directory you placed the files in step 5 and make it writable by the web server (777)
7. Create an empty file saveditems.php and make it writable as well
8. Load your script in your browser for testing, it should forward all notifications for each new item to your iPhone (first time will send a lot), empty out saveditems.php after doing that to make testing the scheduled cron job easier
9. Setup a cron job (using cPanel it is easy but just google for instructions) to run:

wget -O /dev/null http://yourdomain.com/path/to/your/swcript/facebook.php

and schedule it to run however often you want, it isn't true PUSH but having a pull ever minute is close enough for me!

Here is the script (which is almost entirely one of the SimplePie examples that I modified a little:

PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Demo of how to use SimplePie and a flat file database to display old feed items</title>
</head>
<body>
 
 
<?php
 
/*
        This is a demo showing how to use SimplePie and a flat file database to display previous feed items like Google Reader.
 
        Summary
                Load the flat file db into array.
                Run SimplePie.
                Add new feed items to the array.
                Save the array back to the flat file db.
                Loop through the db to display feed items.
 
        Author: Michael Shipley (http://www.michaelpshipley.com/)

Changelog 
20090711 - Jason Bainbridge - http://jasonbainbridge.com
Added some slight modifications to add support for the Prowl iPhone app:
- Includes class.prowl.php and initiates a new session
- Reverses the array of new items so the list in the Prowl app is in descending order
- Pushes each new item to Prowl

*/
 
require 'simplepie.inc';
include "class.prowl.php";

$prowl = new Prowl("your_username", "your_password", "what_you_want_your_app_name_to_be");
 
// db holder
$savedItems = array();
 
// db file name
$savedItemsFilename = 'saveditems.php';
 
// max days to keep items in db
$numberOfDays = 3;
 
$numberOfDaysInSeconds = ($numberOfDays*24*60*60);
$expireDate = time() - $numberOfDaysInSeconds;
 
//you can have one or many rss feeds listed here
$urls = array('www.somedomain.com/feed.rss','anotherdomain.com/feeed.xml);
$feed = new SimplePie();
$feed->set_feed_url($urls);
$feed->set_cache_duration(100);
$feed->init();
 
 
/*
        load flat file db into array
*/
if(file_exists($savedItemsFilename))
{
        $savedItems = unserialize(file_get_contents($savedItemsFilename));
        if(!$savedItems)
        {
                $savedItems = array();
        }
}
 
 
/*
        Loop through items to find new ones and insert them into db
*/
foreach(array_reverse($feed->get_items()) as $item)
{
 
        // if item is too old dont even look at it
        if($item->get_date('U') < $expireDate)
                continue;
 
 
        // make id
        $id = md5($item->get_id());
 
 
        // if item is already in db, skip it
        if(isset($savedItems[$id]))
        {
                continue;
        }
 
        // found new item, add it to db
        $i = array();
        $i['title'] = $item->get_title();
        $i['link'] = $item->get_link();
        $i['author'] = '';
        $author = $item->get_author();
        if($author)
        {
                $i['author'] = $author->get_name();
        }
        $i['date'] = $item->get_date('U');
        $i['content'] = $item->get_content();
        $feed = $item->get_feed();
        $i['feed_link'] = $feed->get_permalink();
        $i['feed_title'] = $feed->get_title();
 
		$result = $prowl->send("FB Notification", $i['title']);

        $savedItems[$id] = $i;
}
 
 
/*
        remove expired items from db
*/
$keys = array_keys($savedItems);
foreach($keys as $key)
{
        if($savedItems[$key]['date'] < $expireDate)
        {
                unset($savedItems[$key]);
        }
}
 
 
/*
        sort items in reverse chronological order
*/
function customSort($a,$b)
{
        return $a['date'] <= $b['date'];
}
uasort($savedItems,'customSort');
 
 
 
/*
        save db
*/
if(!file_put_contents($savedItemsFilename,serialize($savedItems)))
{
        echo ("<strong>Error: Can't save items.</strong><br>");
}
 
 
/*
        display all items from db
*/
echo '<h2>SimplePie + flat file database</h2>';
$count = 1;
foreach($savedItems as $item)
{
        echo $count++ . '. ';
        echo '<strong>' . $item['feed_title'] . '</strong>';
        echo ' : ';
        echo $item['title'];
        echo '<br>';
        echo '<small>' . date('r',$item['date']) . '</small>';
        echo '<br>';
        echo '<br>';
}
 
/*
        for comparison, show all feed items using SimplePie only
*/
echo '<h2>SimplePie only</h2>';
$count = 1;
foreach($feed->get_items() as $item)
{
        echo $count++ . '. ';
        $iFeed = $item->get_feed();
        echo '<strong>' . $iFeed->get_title() . '</strong>';
        echo ' : ';
        echo $item->get_title();
        echo '<br>';
        echo '<small>' . $item->get_date('r') . '</small>';
        echo '<br>';
        echo '<br>';
}
 
/*
        Total counts
*/
        echo '<h2>Total item counts</h2>';
        echo 'Database item count: ' . count($savedItems);
        echo '<br>';
        echo 'SimplePie item count: ' . $feed->get_item_quantity();
        echo '<br>';
?>
 
 
</body>
</html>
 
You can push any RSS feed you like to your iPhone using Prowl if you have access to a web server and don't mind getting your hands dirty.

1. Purchase Prowl from the app store and register for an account
2. Get the Prowl PHP class from - http://code.google.com/p/php-prowl/
3. Get SimplePie to handle RSS feeds from: http://simplepie.org/
4. Edit the below code to contain your user details and your feed(s) you want displayed
5. Upload class.prowl.php, simplepie.inc and whatever you call your cusotmized script (mine is facebook.php as I use it to push Facebook notifications)
6. Create a sub-directory cache in the directory you placed the files in step 5 and make it writable by the web server (777)
7. Create an empty file saveditems.php and make it writable as well
8. Load your script in your browser for testing, it should forward all notifications for each new item to your iPhone (first time will send a lot), empty out saveditems.php after doing that to make testing the scheduled cron job easier
9. Setup a cron job (using cPanel it is easy but just google for instructions) to run:

wget -O /dev/null http://yourdomain.com/path/to/your/swcript/facebook.php

and schedule it to run however often you want, it isn't true PUSH but having a pull ever minute is close enough for me!

Here is the script (which is almost entirely one of the SimplePie examples that I modified a little:

PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Demo of how to use SimplePie and a flat file database to display old feed items</title>
</head>
<body>
 
 
<?php
 
/*
        This is a demo showing how to use SimplePie and a flat file database to display previous feed items like Google Reader.
 
        Summary
                Load the flat file db into array.
                Run SimplePie.
                Add new feed items to the array.
                Save the array back to the flat file db.
                Loop through the db to display feed items.
 
        Author: Michael Shipley (http://www.michaelpshipley.com/)

Changelog 
20090711 - Jason Bainbridge - http://jasonbainbridge.com
Added some slight modifications to add support for the Prowl iPhone app:
- Includes class.prowl.php and initiates a new session
- Reverses the array of new items so the list in the Prowl app is in descending order
- Pushes each new item to Prowl

*/
 
require 'simplepie.inc';
include "class.prowl.php";

$prowl = new Prowl("your_username", "your_password", "what_you_want_your_app_name_to_be");
 
// db holder
$savedItems = array();
 
// db file name
$savedItemsFilename = 'saveditems.php';
 
// max days to keep items in db
$numberOfDays = 3;
 
$numberOfDaysInSeconds = ($numberOfDays*24*60*60);
$expireDate = time() - $numberOfDaysInSeconds;
 
//you can have one or many rss feeds listed here
$urls = array('www.somedomain.com/feed.rss','anotherdomain.com/feeed.xml);
$feed = new SimplePie();
$feed->set_feed_url($urls);
$feed->set_cache_duration(100);
$feed->init();
 
 
/*
        load flat file db into array
*/
if(file_exists($savedItemsFilename))
{
        $savedItems = unserialize(file_get_contents($savedItemsFilename));
        if(!$savedItems)
        {
                $savedItems = array();
        }
}
 
 
/*
        Loop through items to find new ones and insert them into db
*/
foreach(array_reverse($feed->get_items()) as $item)
{
 
        // if item is too old dont even look at it
        if($item->get_date('U') < $expireDate)
                continue;
 
 
        // make id
        $id = md5($item->get_id());
 
 
        // if item is already in db, skip it
        if(isset($savedItems[$id]))
        {
                continue;
        }
 
        // found new item, add it to db
        $i = array();
        $i['title'] = $item->get_title();
        $i['link'] = $item->get_link();
        $i['author'] = '';
        $author = $item->get_author();
        if($author)
        {
                $i['author'] = $author->get_name();
        }
        $i['date'] = $item->get_date('U');
        $i['content'] = $item->get_content();
        $feed = $item->get_feed();
        $i['feed_link'] = $feed->get_permalink();
        $i['feed_title'] = $feed->get_title();
 
		$result = $prowl->send("FB Notification", $i['title']);

        $savedItems[$id] = $i;
}
 
 
/*
        remove expired items from db
*/
$keys = array_keys($savedItems);
foreach($keys as $key)
{
        if($savedItems[$key]['date'] < $expireDate)
        {
                unset($savedItems[$key]);
        }
}
 
 
/*
        sort items in reverse chronological order
*/
function customSort($a,$b)
{
        return $a['date'] <= $b['date'];
}
uasort($savedItems,'customSort');
 
 
 
/*
        save db
*/
if(!file_put_contents($savedItemsFilename,serialize($savedItems)))
{
        echo ("<strong>Error: Can't save items.</strong><br>");
}
 
 
/*
        display all items from db
*/
echo '<h2>SimplePie + flat file database</h2>';
$count = 1;
foreach($savedItems as $item)
{
        echo $count++ . '. ';
        echo '<strong>' . $item['feed_title'] . '</strong>';
        echo ' : ';
        echo $item['title'];
        echo '<br>';
        echo '<small>' . date('r',$item['date']) . '</small>';
        echo '<br>';
        echo '<br>';
}
 
/*
        for comparison, show all feed items using SimplePie only
*/
echo '<h2>SimplePie only</h2>';
$count = 1;
foreach($feed->get_items() as $item)
{
        echo $count++ . '. ';
        $iFeed = $item->get_feed();
        echo '<strong>' . $iFeed->get_title() . '</strong>';
        echo ' : ';
        echo $item->get_title();
        echo '<br>';
        echo '<small>' . $item->get_date('r') . '</small>';
        echo '<br>';
        echo '<br>';
}
 
/*
        Total counts
*/
        echo '<h2>Total item counts</h2>';
        echo 'Database item count: ' . count($savedItems);
        echo '<br>';
        echo 'SimplePie item count: ' . $feed->get_item_quantity();
        echo '<br>';
?>
 
 
</body>
</html>

Wow, now that's what I call a complicated but good way of getting push for any app :p, thanks!
 
Wow, now that's what I call a complicated but good way of getting push for any app :p, thanks!

It isn't that complicated really, just took a lot of steps to explain so most people would be able to understand it. Next up is to "push" Twitter @'s and DM's but their limit on API calls is going to make that much more of a pseudo push than real push.
 
jaseone......

Using your directions I finally got passed all the PHP errors. Added 3 feeds but when I run the script I only get this....

SimplePie + flat file database
SimplePie only
Total item counts
Database item count: 0
SimplePie item count: 0

Any ideas??
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.