Always wanted more content on your page? Then here is the solution! Integrate RSS feeds from others into your site, make it appear like you are serving the fresh news. So lets get started.
First of all this is going to be as easy as possible. We first need a PHP script that gets and parses the feed we are going to use. Todays choice was Magpierss-0.72. You can download it direct from here. You need winrar or some other advanced zip like tool to unpack the files. Once downloaded you just unpack all the files, upload it to your webserver and puts it in a directory named magpierss-0.72.
So we have to create the reader.php file, you can name it whatever you want but remember that it has to be a *.php file. Put in the code below, change the $URL variable with whatever feed you want and save the file, upload it next to the magpierss-0.72 folder and goto yoursite.com/reader.php. Now you see the magic happens, then you can use basic php->include() function to put it on your front page or other places you want it. Experiment and make it look lite the post you allready have on your page! :) Enjoy!
Here is the code of reader.php:
<div class="content">
<?php
require_once("magpierss-0.72/rss_fetch.inc"); # Here you define where magpie is.
define('MAGPIE_OUTPUT_ENCODING', 'utf-8'); # Choose your encoding
$url = "http://www.pixel2life.com/feeds/latest_15_tuts.xml"; # Define where the feed is, i picked pixel2life.com's tutorial feed
$rss = fetch_rss( $url );
$num_items = 10; # Pick a number of items from the feed you want to display
$items = array_slice($rss->items, 0, $num_items);
foreach ($items as $item) {
$ahref = $item['link'];
$title = $item['title'];
$description = $item['description']; # This doesnt work on p2l but other feeds have description so i didn't remove it if you want it ;)
print "<b><a href=$ahref>$title</a></b><br />$description<br /><br />";
SitePoint Podcast #6: What to do about Internet Explorer 6 Episode 6 of The SitePoint Podcast is now available! This week your hosts are Brad Williams, Patrick O’Keefe, Stephan Segraves, and Kevin Yank.
Listen in your Browser
Play this episode directly in your browser! Just click the orange “play” button below:
Download this Episode
You can also download this episode as a standalone MP3 file. Here’s the link:
SitePoint Podcast
How to Find Breaking News on Twitter Unless you follow a bajillion people and never sleep, using Twitter to find breaking news is difficult. And yet, breaking news is something at which Twitter excels. Here is one way to find news on Twitter without losing sleep.
Kuler Adds Cool Data Visualization What colors are popular in different parts of the world? What about at different times of the year? Thanks to a new data visualization from Adobe's cool color community Kuler, those questions can now be answered.
New York Times Releases Another API The New York Times might be running on fumes, but they've actually been doing a lot of cool stuff with all the data they and others have collected over the years. Today they released their fifth data API.
Two Trillion Reasons Why KIDO’Z Will Succeed Keeping kids safe on the Internet could turn out to be a multi-trillion dollar industry. At least, that's what the makers of a kids-only web browser, KIDO'Z, are banking on. Phil reviews the browser and wonders why he didn't think of the idea himself.
The Internet is Taking the Shine off of Apple Apple is starting to lose a little bit of their shine, but why? One reason might be their approach to the Internet: so far, they're doing it wrong.
The Future of the Music Business: Soulja Boy? Really? That guy?! It's easy to dismiss Soulja Boy, the 18-year-old rapper who has risen to fame and fortune over the past couple of years. But that would be a mistake -- his blueprint for success is the future of the music biz.
Why Facebook Will Have a Big 2009 In the predictions post we ran at the end of December, we said Facebook would have a huge upcoming year, but we didn't really say why. So here are 4 reasons why 2009 will be a good year for the world's biggest social network.
Are All Web App Platforms Doomed by Fatigue? The flood of applications that inevitably follows the launch of a hot new web app platform leads to what we've termed app fatigue. It happened to Facebook, and now it's happening to the iPhone. Is it the ultimate fate of all app platforms?
Apple’s iWork.com Disappoints - Not a Google Docs Competitor During their annual keynote at the MacWorld conference in San Francisco today, Apple announced a beta of iWork.com, their cloud-based productivity suite that was rumored last week. It's a software + services approach.