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 />";
JOIN our mailing list TODAY here to get the latest NEWS and BEST offers:
Warning: main(http://rssarticles.itstyle.net/maillist/register.php) [function.main]: failed to open stream: HTTP request failed! HTTP/1.1 500 Generated error
in /usr/home/web/wno19625/rssarticles/index.php on line 160
Warning: main() [function.include]: Failed opening 'http://rssarticles.itstyle.net/maillist/register.php' for inclusion (include_path='/home/web/wno19625/rssarticles/comment/configuration:/home/web/wno19625/rssarticles/comment/include:/home/web/wno19625/rssarticles/comment/include/library:./:.:/usr/local/share/pear:') in /usr/home/web/wno19625/rssarticles/index.php on line 160
SitePoint Podcast #52: Building Communities with Derek Powazek, Part 1 Derek Powazek, co-creator of JPG Magazine and creator of Fray, drops by to discuss the care and feeding of web communities. We touch on the place of forums in a Web 2.0 world, creating communities around commercial products, the potential value of closed communities, and balancing user demands against your own plans.
Related posts:
How to Get Control of Your Business Finances As a business owner, having a solid process for creating, tracking and analyzing your budget is extremely important. Alyssa gives you some areas to consider.
Related posts:
Windows 7 Sells 90 Million Copies Microsoft are reporting high Windows 7 sales since the OS was launched in 2009. Craig examines how the figures compare to Vista and whether Windows 7 has really been the success Microsoft needed.
Related posts:
Express Yourself with Creative Prototypes In today's tutorial, user experience expert Shane Morris takes Microsoft's Prototyping tool SketchFlow for a test drive.
Related posts:
How I Use Evernote to Manage My Ideas As a follow-up to a previous post, today Alyssa shares her process for managing and organizing ideas.
Related posts: