Warning: session_start() [function.session-start]: open(/home/web/wno19625/.tmp/sess_3152f04745f390fd33969a260d3ba767, 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 Internal Server 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 - 01/28/2012 - 01:09
Powered by Comment Script

SitePoint Podcast #147: The CSS Ninja with Ryan Seddon
podcast-default-115x115In this week's podcast, host Louis Simoneau interviews Ryan Seddon about his course on Modernizr, his work on fontdragr.com, and his other CSS projects too.




Managing Multiple Sites with WordPress Network
wordpress-logo-115x115Managing and updating software for multiple WordPress sites can be a real hassle. Daniel Shamburger finds WordPress Network makes it much easier.




What Expectations Are You Setting With Clients?
expectationsClient expectations cut both ways, and Brandon argues if anyone's going to set them correctly from the start it'll have to be you.




Tips for Designing an Amazing Proposal
proposalBrandon Eley's company recently reviewed how they frame their proposals and ended up making quite a lot of changes. Have you reviewed yours lately?




5 Steps To Guarantee Client Payment
623-moneyLate payment affects your cashflow and you'll lose more time and money chasing clients. Craig reveals 5 tips to avoid those hassles again.




Talk Yourself Up … Without Sounding Like an Egomaniac
1079846_platinum_micScared you'll sound like a narcissistic self-promoter if you talk about yourself with prospects? Georgina has a few suggestions to help shy types promote their work in client conversations.




5 Unbreakable Rules of Landing Page Design
landingZach Ball has identified five key areas to which you must pay attention if you want to develop a most effective landing page for your website.




What’s Happening on RubySource?
rubysource-icon115x115Ruby, and its numerous frameworks, are gaining increasing popularity with developers all over the globe. If you’re interested in getting involved, check out some of the highlights from RubySource Rails or Sinatra: The Best of Both Worlds The Ruby world has been blessed with more than its fair share of frameworks for developing web applications




What can YOU do with 1 Kilobyte of CSS?
629-css-1kCraig takes a look at the CSS1K project which hopes to illustrate how clever developers can be with 1 kilobyte of CSS code.




SEO Alert! Google Downgrades Pages With Too Many Ads
628-seo-adsGoogle has announced an algorithm change which downgrades any site with too many adverts above the fold. Craig discusses the policy and whether Google is starting to dictate how you design web pages.








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


Warning: Unknown(): open(/home/web/wno19625/.tmp/sess_3152f04745f390fd33969a260d3ba767, 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