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:
Sign Up
Name
Email 




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

Comments

Great article!
This is fun, it works on almost any RSS i have tried. With some adjustments to some of them, but it's really easy.
#1 - Ryan - 11/01/2007 - 13:39
Online PHP Tutorials
Gr8! very help full
#2 - Salman - 11/13/2007 - 06:13
Tutorials
I try this one and work gr8.
#3 - Shaheen Impex - 11/17/2007 - 09:54
Good work.
You liked it, Shaheen? I'm glad, 'cause I did, too. Very well explained and laid out.
#4 - Adam - 12/08/2007 - 03:04
Helpfull
I have tried this it's Excellent

thanks for Sharing
#5 - Online Java Script Tutorials - 11/15/2008 - 12:11
Name
E-mail (Will not appear online)
Homepage
Title
Comment
;-) :-) :-D :-( :-o >-( B-) :oops: :-[] :-P
To prevent automated Bots form spamming, please enter the text you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.



Powered by Comment Script

Poll: Is RSS Mainstream?
Could RSS be crossing over into the mainstream? New data about RSS readers from one of the web's biggest blogs might suggest that it is. But data from one blog, no matter how large, isn't a big enough sample size, so vote in our poll and let us know what you think.



Why The data: URI Scheme Could Help Save Your Slow Site
Slow page loads getting you down? The data: URI scheme could be the solution! While not supported in all browsers yet, data: URIs allow you to embed images within an HTML documents, thus reducing the need for an http request. As Meitar describes, it couldn't be easier to use—whether you're calling images for content within your HTML, or for background decoration from your style sheet.



Google To Launch Customizable Search Tonight
Google tonight will be opening up to the public an experimental feature they've been testing for a few months called SearchWiki, which lets users reorder and remove results, and leave comments on specific links.



10 Must Have Tools for Communicating with Clients
Communicating your clients is a necessary evil of contract web development, design, programming, writing, or any other freelance art form. Our round up of ten must have web-based tools below will help you better communicate with clients, and and help you keep your sanity.



HelpingKind.org: A Pay It Forward Marketplace
People helping other people is an old idea, but in today's hustle-bustle, impersonal world of online communications, it may actually seem novel. The idea certainly has legs, though, says Dave Dalton, which is why he started a marketplace for people to trade good deeds.



If Twitter Charges, Users Would Pay: Survey
Would you pay to use Twitter? An unscientific survey conducted today found that about 50% of users would pay $5 per month or more for the service. Another survey found that a quarter of users would pay to remove ads if the service started putting them in feeds. How about you?



NASA Tests First ‘Deep Space Internet’
What do you get when you mix Vint Cerf, NASA, and a spacecraft zipping around space 20 million miles from Earth? The first interplanetary Internet, of course! NASA reports today on the successful trial of the first deep space Internet communications network.



Yahoo! Launches BrowserPlus, Plans to Open Source It
Yahoo!'s cross-browser RIA platform BrowserPlus official crawled out into the public today, promising a way to enable "in-browser desktop applications," which is a fancy way of saying that it allows developers to add desktop-like functionality to web-based apps.



6 Steps to Professional Podcast Publishing
A couple of weeks ago, I offered up 8 Professional Podcast Production Tips. If you followed those, you should have a professional-sounding show all ready for the world to hear. But how do you get it out there?



The Downside of Free
The freemium revenue model, in which limited versions of web services are given out for free with more feature rich versions sold for a price, can make you a lot of money as an app developer. But there are some pitfalls you should be aware of.







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