RSS ticker in NT

Discuss possible software enhancements/changes here.

Moderator: Matt

Post Reply
djstatic
 

Posts: 175
Joined: Fri Apr 16, 2010 8:59 pm
Location: South East QLD, Gold Coast

RSS ticker in NT

Post by djstatic »

As I was using NT and just updated to the test release, I though it would be good if NT actually told you the latest news (and the news was updated a little more frequently ;)).

I assume some users don't check in to the website or forum as often as they could/should and may miss stuff.

I think NT should have an RSS ticker that scrolls in the status bar (but not bold enough to be distracting), something like this:
Image

I've aggregated the feed already:
http://minett.com.au/skyline/scraper.php

This is the php code for it:

Code: Select all

<?
echo "<?xml version=\"1.0\"?>\n<rss version=\"2.0\">\n<channel>\n";

$html = file_get_contents('http://nistune.com/news.php'); //grab the news page

// find each article
preg_match_all(
    '/<div id=\'contentbox\'>.*?<a name=\'(.*?)\'><\/a>.*?<span class=\'mediumbold\'>(.*?)<\/span>.*?<i>(.*?)<\/i>.*?<br\/>(.*?)<\/div>.*?<div id=\'spacerbox\'>&nbsp;<\/div>/s',
    $html,
    $posts, // will contain the news posts
    PREG_SET_ORDER // formats data into an array of posts
);

// loop through the new posts in RSS/XML format
foreach ($posts as $post) {
    $link = $post[1];
    $title = $post[2];
    $date = $post[3];
    $content = $post[4];

    echo "<item>\n <title>".$date.": ".$title."</title>\n";
    echo "<description>".$content."</description>";
    echo "<link>http://nistune.com/news.php#".$link."</link>\n</item>";
}

?>
</channel>
</rss>
you could just save the code to http://nistune.com/rss.php to pull the news from the site
Post Reply