Warning: session_start() [function.session-start]: open(/home/web/wno19625/.tmp/sess_73f02bd940e66c648bcebd5f91172bbe, O_RDWR) failed: Permission denied (13) in /usr/home/web/wno19625/rssarticles/comment/include/session.class.inc.php on line 69

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /usr/home/web/wno19625/rssarticles/comment/include/session.class.inc.php:69) in /usr/home/web/wno19625/rssarticles/comment/include/session.class.inc.php on line 69

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/home/web/wno19625/rssarticles/comment/include/session.class.inc.php:69) in /usr/home/web/wno19625/rssarticles/comment/include/session.class.inc.php on line 69
Integrate RSS feeds to your page with PHP

 

Web, RSS, traffic and money making Information

 

Menu: 15 Tips blog traffic - What are RSS feeds - Marketers should Blog - Integrate RSS on your Blog/page - Include Files PHP

Google

Integrate RSS feeds to your page with PHP

by: Mats Holmvik

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.

RSS

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 />";

}

?>

</div>


Live example here: http://rssarticles.itstyle.net/magpietutorialtest.php

 

Resources: http://magpierss.sourceforge.net/ www.php.net www.pixel2life.com




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



Comment Script
Post this page to: del.icio.us Yahoo! MyWeb Digg reddit Furl Blinklist Spurl

Comments

Comment display has been turned off.
#1 - Administrator - 02/09/2010 - 00:19
Powered by Comment Script

Microsoft is finally adapting
Let me start of by saying that I’m a proponent of a lot of the development tools that Microsoft makes. Some might go so far as calling me a Microsoft fanboy in some cases. However, my feelings toward Microsoft technology is far from blind about it’s shortcomings. I’ve spent hours getting my CSS layouts to



IE 7 Update for Pirated Windows Users
The Microsoft Internet Explorer Weblog has announced that the latest update to Internet Explorer 7 will drop the Windows Genuine Advantage (WGA) validation step from the installer. Although the announcement stops just shy of saying it, the real effect of this move is to allow people running pirated versions of Windows XP and Windows Server



Do less
So I got persuaded into blogging for Sitepoint and this is my first post. I’ll be writing mostly about PHP, since that’s my main area of competence, but will probably touch on related topics. Anyway, in an attempt to not turn this into yet another “Hello World”, I figured I would reflect a bit on what’s



A Survival Guide for ASP.NET Developers
I’m very proud to announce the availability of our latest release, The ASP.NET 2.0 Anthology: 101 Essential Tips, Tricks & Hacks. If you’re wading through lines of ASP.NET code every day — or even if you just dabble occasionally — then this book is a must-have companion for trekking through the ASP.NET jungle. It features some of



Comment-Driven Development
You’ve probably heard about Test Driven Development, a programming methodology which focusses on test cases as a framework for designing and developing code. You may also have heard of Behavior Driven Development, a more holistic approach which focusses on the behavior of an application before and during the development process. Well let me tell you about



Usability: More than Skin Deep at Web Directions
At Web Directions South 2007 in Sydney, SitePoint usability blogger Lisa Herrod (aka Scenario Girl) proposed a new way of looking at usability and accessibility within the web design process. Not only does her approach point the way to better user experience design, but it also brings formal accessibility testing within reach of small web



And the iPod Touch goes to…
At the Web Directions South conference in Sydney a couple of weeks ago, SitePoint ran a competition for conference-goers to win an iPod Touch. To enter, attendees had to answer the question, Why do you love the Web? The competition drew an enormous number of entries that were funny, serious and just plain weird. However, after



Client-side Load Balancing Web 2.0 Apps is Voodoo
Digital Web recently published an article about “Client Side Load Balancing for Web 2.0 Applications“. I wanted to take a moment to explain why I think this load balancing technique is a bad idea. But first, here’s the concept in brief: Your web site is deployed in an identical fashion across a number of



Skinning and color palettes with HSV and transparent PNGs
I work on the Ajaxy Web UI for Chandler Server (a.k.a. Cosmo), an open-source server that works with the Chandler personal information manager (PIM). You can take a look at the Web UI by creating an account on our free online service, Chandler Hub. As we started implementing more and more of the calendar features in



.NET Framework Source Code to be Released!
Scott Guthrie has made the very, very cool announcement that the bulk of the .NET framework source code will be released! If you have ever spent hours trying to decypher ASP.NET in reflector, or pulling your hair out trying to make custom controls play well, this should make you a very happy person.







Copyright © 2007 RSSArticles.itstyle.net . All rights reserved. Sitemap


Warning: Unknown(): open(/home/web/wno19625/.tmp/sess_73f02bd940e66c648bcebd5f91172bbe, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/home/web/wno19625/.tmp) in Unknown on line 0