Page 1 of 1

RSS feed for home page news

Posted: Fri Jan 16, 2004 11:59 pm
by Red Squirrel
Added a RSS feed for the home page news

http://www.iceteks.com/news/rssfeed.xml

Enjoy! B)

Archived topic from Iceteks, old topic ID:1923, old post ID:15714

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:00 am
by brandon
What exactly is RSS????

Archived topic from Iceteks, old topic ID:1923, old post ID:15716

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:03 am
by Red Squirrel
I did not know what it was until I read this thread. Then I figured it would be cool to make my own. :D

In short it's a standard way to view news without a browser. You can subscribe to news feeds such as CNN and get up to date stuff as it is added to the site.

Archived topic from Iceteks, old topic ID:1923, old post ID:15718

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:11 am
by Chris Vogel
Although I don't use RSS, I think it is wonderful. I'm glad we have it. :)

So was it very simple? (The RSS, I mean. Not the PHP behind it.) It looks simple from what I've seen.

EDIT:
such as CNN
Actually, I don't think CNN provides feeds. :(

Archived topic from Iceteks, old topic ID:1923, old post ID:15719

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:18 am
by Red Squirrel
It was pretty easy, for something that, yesterday, I did not know what it was. :lol2: the php was pretty easy too... actually this is the source code for it:

Code: Select all

<?php
header("Content-type: application/rss+xml");
echo("<?xml version="1.0" ?>
");
?>
<rss version="2.0">

    <channel>

    <title>Outside Articles</title>
    <description>Various reviews and articles from around the tech globe!</description>
    <link>http://www.iceteks.com</link>




<?php

$sqlinfo = mysql_connect("localhost","iceteks_root","I_do_not_publicly_display_passwords");

$result = mysql_select_db("iceteks_frontpagenews",$sqlinfo);

$result = mysql_query("select * from main order by date desc limit 100;") or die("<font color="red">SQL Error: " . mysql_error()."</font>");

$count = mysql_num_rows($result);


while($count>0)
{
$info = mysql_fetch_array($result);

$info[content] =  str_replace('
', '
', $info[content]);
$info[link] =  str_replace('&', '&', $info[link]);

$info[content] =  str_replace('&', '&', $info[content]);
$info[title] =  str_replace('&', '&', $info[title]);

$info[content] =  str_replace('’', ''', $info[content]);
$info[title] =  str_replace('’', ''', $info[title]);

$info[content] =  str_replace('‘', ''', $info[content]);
$info[title] =  str_replace('‘', ''', $info[title]);

$info[content] =  str_replace('£', '[euro]', $info[content]);
$info[title] =  str_replace('£', '[euro]', $info[title]);

$info[content] =  str_replace('“', '"', $info[content]);
$info[title] =  str_replace('“', '"', $info[title]);

$info[content] =  str_replace('”', '"', $info[content]);
$info[title] =  str_replace('”', '"', $info[title]);

$info[content] =  str_replace('®', '(R)', $info[content]);
$info[title] =  str_replace('®', '(R)', $info[title]);

$info[content] =  str_replace('™', '(TM)', $info[content]);
$info[title] =  str_replace('™', '(TM)', $info[title]);







?>

    <item>
    <title><?php echo($info[title]);?></title>
    <description><?php echo($info[content]);?></description>
    <link><?php echo($info[link]);?></link>
    </item>


<?php
$count--;
}


mysql_close($sqlinfo);
?>

    </channel>

    </rss>
[code] 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:1923, old post ID:15720[/size][/color]

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:29 am
by brandon
Yeah, it sure looks easy.

Maybe I should take up 311th grade math too.

Well, thanx for telling me Red.

Archived topic from Iceteks, old topic ID:1923, old post ID:15723

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:31 am
by Red Squirrel
lol, no math involve at all in this. :D

I just added the date in the titles. Makes for a more convinient RSS experience. :D Later on I might add more channels for new posts and stuff.

Archived topic from Iceteks, old topic ID:1923, old post ID:15725

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:34 am
by brandon
Let me rephrase that.

It'd be easier to get a Hernia.

Archived topic from Iceteks, old topic ID:1923, old post ID:15727

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:35 am
by Red Squirrel
what's Hernia?

Archived topic from Iceteks, old topic ID:1923, old post ID:15729

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:35 am
by Chris Vogel
Have you ever noticed how RSS is just one letter away from *that*? :wub:

Someone remind me to implement this on my billion-hits-per-day site when it debuts, okay?

Archived topic from Iceteks, old topic ID:1923, old post ID:15730

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:38 am
by Chris Vogel
Red Squirrel wrote: what's Hernia?
a protrusion of an organ or part through connective tissue or through a wall of the cavity in which it is normally enclosed -- called also rupture


Brandon, the hardest thing there is the PHP, and that's something I feel you could pick up on quickly enough. Out of that PHP, most of it is just one function used again and again.

Archived topic from Iceteks, old topic ID:1923, old post ID:15732

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:42 am
by brandon
takahita_tsukino wrote:
Brandon, the hardest thing there is the PHP, and that's something I feel you could pick up on quickly enough.  Out of that PHP, most of it is just one function used again and again.
Are you saying that to flatter me, or are you trying to say something else???

I have no clue when it comes to programming. I just know alot about computers.

Archived topic from Iceteks, old topic ID:1923, old post ID:15733

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:43 am
by Red Squirrel
Brandon, the hardest thing there is the PHP, and that's something I feel you could pick up on quickly enough.  Out of that PHP, most of it is just one function used again and again.
Yep, actually based on the two tutorials I have, you could easly pick up on that code. Basically what it does is pull out the 100 latest entries in the database and display them in the right format.

Archived topic from Iceteks, old topic ID:1923, old post ID:15734

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:45 am
by brandon
I won't have to hand-code will I????

Archived topic from Iceteks, old topic ID:1923, old post ID:15736

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:53 am
by Red Squirrel
As in typing all that yourself? Yes and no. There's lot of repeat stuff I keep in text files and just copy and paste when I need it. For example, the whole mysql proceedure is saved in a text file called sql.txt or whatever in my programming folder, so I just copy and paste.

Archived topic from Iceteks, old topic ID:1923, old post ID:15740

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:58 am
by brandon
If I ever have the time, and the attention span, I'll be sure to read your tutorial.

However, I'm only 16, so I can't really afford a host, and I can't find any good ones that support MySQL or PHP.

But I'll be sure to read them, because when I find that free-host that does offer that, then I will set-up an invision board there.

Archived topic from Iceteks, old topic ID:1923, old post ID:15742

RSS feed for home page news

Posted: Sat Jan 17, 2004 12:59 am
by Red Squirrel
Yeah free ones are hard to find... that have php and mysql. I'm sure there must be some though. You can always setup your own server too.

Archived topic from Iceteks, old topic ID:1923, old post ID:15743

RSS feed for home page news

Posted: Sat Jan 17, 2004 1:01 am
by brandon
Are you talking about setting up a web-server on my PC????

I'll have to read-up on apache before I do that.

Archived topic from Iceteks, old topic ID:1923, old post ID:15746

RSS feed for home page news

Posted: Sat Jan 17, 2004 1:18 am
by Red Squirrel
Yeah, it's hard at first but once you do it once it's easy. I'm saving up so I can build myself a LAN server. The problem with using an external server to host a site is that most isps don't allow that, so it's a one shot deal, if you get caught you have to take it down. I heard it's even stricter in the USA then canada with that. You usually get escorted by the FBI and stuff, but that's what I heard, have a hard time believing it's to that extent. I think the worse thing is an account suspension until you remove it, or something like that. But if it's on a LAN, it does not matter since only you can access it from the lan.

Archived topic from Iceteks, old topic ID:1923, old post ID:15759

RSS feed for home page news

Posted: Sat Jan 17, 2004 1:31 am
by brandon
Hmm, sounds very risky.

Archived topic from Iceteks, old topic ID:1923, old post ID:15764

RSS feed for home page news

Posted: Sat Jan 17, 2004 1:32 am
by Red Squirrel
It is. This site was down for a month because of that, and it could have been permanent.

Archived topic from Iceteks, old topic ID:1923, old post ID:15765

RSS feed for home page news

Posted: Sat Jan 17, 2004 1:38 am
by brandon
Well, it seems like it's not worth the risk to me.

Archived topic from Iceteks, old topic ID:1923, old post ID:15767

RSS feed for home page news

Posted: Sat Jan 17, 2004 1:51 am
by Red Squirrel
yeah it is a risk...

Archived topic from Iceteks, old topic ID:1923, old post ID:15770

RSS feed for home page news

Posted: Sat Jan 17, 2004 2:01 am
by brandon
Well, you can scrap that idea.

I found a few hosts that offer PHP/MySQL, but they have ads on them.

I was looking for a free one with no ads, that had support for them.

Archived topic from Iceteks, old topic ID:1923, old post ID:15773

RSS feed for home page news

Posted: Sat Jan 17, 2004 2:15 am
by Red Squirrel
that will probably be impossible to find with no ads. But even if it has ads at least you'll have a host to learn it on and stuff.

Archived topic from Iceteks, old topic ID:1923, old post ID:15777