Combine Two WordPress RSS feed into a single Feed

If you have two blogs installed on same domain, you may want to combine two blogs feed into one blog feed. It will provide few benefits:

a) Ease of feed management

b) More readers

c) Better feed stats and much more

Required tools

=> MagpieRSS rss parser for php (download link)

=> FeedCreator lets you easily create RSS 0.91, 1.0 or 2.0, ATOM 0.3 and OPML 1.0 feeds with PHP (download link).

Download required tools

Download required tools to your desktop and upload to your server in myfeed directory using ftp / sftp client. Following instructions assumes that you have a shell access to server:
mkdir myfeed
cd myfeed
wget http://internap.dl.sourceforge.net/sourceforge/magpierss/magpierss-0.72.tar.gz
tar -zxvf magpierss-0.72.tar.gz
cp magpierss-0.72/*.inc .
mv magpierss-0.72/extlib/ .
rm -rf magpierss-0.72*
wget http://www.bitfolge.de/download/feedcreator_172.zip
unzip feedcreator_172.zip
rm *.zip *.txt

Create rss.php script

Now you have all required tools, just create rss.php script :

<?php
$TMP_ROOT = "/tmp";
$DOMAIN_NAME = "http://theos.in/";
$SITE_TITLE = "Your Site / blog Title";
$SITE_DESRIPTION = "Your Site / blog Description";
$SITE_AUTHOR = "Vivek";
$SITE_LOG_URL = $DOMAIN_NAME."logo.jpg";
$RSS_DIR = "/home/lighttpd/theos.in/http";
 
define('MAGPIE_DIR', $RSS_DIR.'/myfeed/');
define('MAGPIE_CACHE_DIR', $TMP_ROOT.'/rsscache');
 
/* include required files */
@require_once(MAGPIE_DIR.'rss_fetch.inc');
@include(MAGPIE_DIR.'feedcreator.class.php');
 
/* Set RSS properties */
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = $SITE_TITLE;
$rss->description = $SITE_DESRIPTION;
$rss->link = $DOMAIN_NAME;
$rss->syndicationURL = $DOMAIN_NAME."/rss/rss.php";
 
/* Set Image properties */
$image = new FeedImage();
$image->title = $SITE_TITLE. " Logo";
$image->url = $SITE_LOG_URL;
$image->link = $DOMAIN_NAME;
$image->description = "Feed provided by ". $SITE_TITLE. ". Click to visit.";
$rss->image = $image;
 
/**************************************************************
showSummery() - Fetch and build new feed
$url = Feed url
$num = Show the most recent posts (default = 10 )
$showfullfeed = true or false, for each article, show full text or summary (default false / summary text)
***************************************************************/
function showSummery($url,$num=10,$showfullfeed=false){
global $rss, $DOMAIN_NAME, $SITE_AUTHOR, $SITE_TITLE;
$num_items = $num;
@$rss1 = fetch_rss( $url );
if ( $rss1 )
{
        $items = array_slice($rss1->items, 0, $num_items);
        foreach ($items as $item)
        {
                $href = $item['link'];
                $title = $item['title'];
                if ( ! $showfullfeed ) {
                        $desc = $item['description'];
                }else{
                        $desc =  $item['content']['encoded'];
                }
                $desc .=  '<p>Copyright &copy; <a href="'.$DOMAIN_NAME.'">'.$SITE_TITLE.'</a>.  All Rights Reserved.</p>';
                $pdate = $item['pubdate'];
                $item = new FeedItem();
                $item->title = $title;
                $item->link = $href;
                $item->description = $desc;
                $item->date = $pdate;
                $item->source = $DOMAIN_NAME;
                $item->author = $SITE_AUTHOR;
                $rss->addItem($item);
        }
}
else
{
   echo "Error: Cannot fetch feed url - ".$url;
}
} // end showSummery()
//***************************************************************/
// Add your feed below:
// showSummery("http://path-to/url/feed",number-of-rss-items,false)
//****************************************************************/
showSummery("http://theos.in/feed/");
showSummery("https://www.cyberciti.biz/tips/feed/");
showSummery("https://www.cyberciti.biz/faq/feed/",5,false);
 
// get your news items from other feed and display back
$rss->saveFeed("RSS1.0", $TMP_ROOT."/rsscache/feed.xml");
?>

Customize script

Set temporary directory to cache rss feed, web server must be able to write to this directory.
$TMP_ROOT = "/tmp";
Set path to rss directory:
$RSS_DIR = "/home/lighttpd/theos.in/http";
Set your domain name, site title, description and author name:
$DOMAIN_NAME = "http://theos.in/";
$SITE_TITLE = "Your Site / blog Title";
$SITE_DESRIPTION = "Your Site / blog Description";
$SITE_AUTHOR = "Vivek";

Finally, set logo file name (replace logo.jpg with actual logo file name):
$SITE_LOG_URL = $DOMAIN_NAME."logo.jpg";

showSummery() function

showSummery($url,$num=10,$showfullfeed=false) fetch remote feed url and build new feed. It accept following arguments:

  • $url = Feed url
  • $num = Show the most recent posts (default = 10 )
  • $showfullfeed = true or false, for each article, show full text or summary (default false )

To combine two RSS feed http://theos.in/blog1/feed/ and http://theos.in/blog2/feed/, call showSummery():
showSummery("http://theos.in/blog1/feed/");
showSummery("http://theos.in/blog2/feed/");
showSummery("http://other-my-blog.com/feed/",5,true); // full feed

Test it

Open a web browser and type url http://your-domain.com/myfeed/rss.php

Download all files and required tools

=> You can download rss.php and required tools here (all GPL licensed except FeedCreator which is under LGPL)

Other tools – Yahoo Pipes

You can use 3rd party service such as Yahoo Pipes, which is an interactive feed aggregator and manipulator. Personally, I like to keep more control on my feed, hence I wrote this script.

Howto setup and configure Windows Server 2003 DHCP server

The Dynamic Host Configuration Protocol (DHCP) is a set of rules used by communications devices such as a computer, router or network adapter to allow the device to request and obtain an IP address from a server which has a list of addresses available for assignment. The Dynamic Host Configuration Protocol (DHCP) is a member of the TCP/IP suite and a protocol that is designed to save network administrators a lot of time and effort. A successful DHCP implementation can do just that.

This article explains setting up DHCP on tens, hundreds, and even thousands of computers can be daunting. Here’s how to do it easily with Windows Server 2003:

As you probably already know, every computer that communicates on a network does so via an IP (layer 4) address. The goal of DHCP is to provide a mechanism of automated address delivery, to give every computer its own IP address without an administrator having to type them all in manually. In small networks, this isn’t too big of an issue. However, in networks with tens, hundreds, and even thousands of computers, the task of IP address management is daunting. Luckily, Windows Server 2003 provides a means for us to implement DHCP with its own DHCP server service

Implementing and Understanding DHCP

What steps should be taken when upgrading an operating system from Windows 98 to Windows Vista / XP?

A friend of mine emailed me a question:

What steps should be taken when upgrading an operating system from Windows 98 to Windows XP?

The first and most important step is backup your data to Pen drive, DVD or external hard disk. You should backup
a] Your emails and settings
b] Your Browser bookmarks and settings
c] Your documents and other personal files

This step-by-step article describes how to prepare to upgrade from Microsoft Windows 98 or Microsoft Windows Millennium Edition to Microsoft Windows XP. The information in this article may be useful to help you avoid some common upgrade-related issues.

Read more: How to prepare to upgrade Windows 98 or Windows Millennium Edition to Windows XP

vBulletin forum change or edit subject titles for individual post

If you need to change post title login as admin or as mod, open individual thread. At the top of each thread, you will see thread tools

Task: vBulletin edit titles

a) Click on Thread tools

b) A small popup will open (see image below)

c) You will see the list of Moderation tool

d) Select Edit thread

vBulletin forum change or edit subject titles for individual post

e) Click on perform action

f) Now you can edit post title as follows:
vBulletin forum change title

All in one tutorial for Photoshop, Paint Shop Pro, Fireworks template XHTML and CSS

This site is a free resource for the budding web designer looking to take the step into the future of modern web design. Throughout the guide, you will be shown cunning CSS techniques used to keep loadtime to a minimum and to organize and fine tune your content so it is presented in the best possible way.

You will learn howto turn a Photoshop, Paint Shop Pro or Fireworks template into a fully sliced, coded and XHTML and CSS valid web page.

CSS Slicing Guide – learn to slice your templates into fully valid XHTML and CSS web pages