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.

How to Improve Wireless Card, Router and Network performance for better experience

Microsoft has published list of 10 tips for improving wireless network performance:

If Windows ever notifies you about a weak signal, it probably means your connection isn’t as fast or as reliable as it could be. Worse, you might lose your connection entirely in some parts of your home. If you’re looking to improve the signal for your wireless network, try some of these tips for extending your wireless range and improving your wireless network performance.

Read more

How to: Find out domain expiration date

My friend recently lost her domain name as she forgot to renew it. Now there is no way she can get back the domain name. So how do you find out domain expiration date?

There are 3 simple ways:

By checking the public WHOIS database

Visit whois service here and enter your domain name. You can also use your domain registrar whois service to find out information.

By logging into your domain service providers account

Login to your domain registrar account and list expiring domain. Make sure you set all domains to auto renewal. Finally, make sure your credit card / payment information is upto date to avoid delays.

By using automated shell scripts for Linux /UNIX / Mac OS X

You can grab modified shell script that run as a cron job from your own Mac OS X / Unix computer. This script checks to see if a domain has expired. It can be run in interactive and batch mode, and provides facilities to alarm (email) if a domain is about to expire in advance.

Free Windows Software

If anyone has any information about free domain remainder utility for Windows XP / Vista, please add them in the comments.

Most domain register provides a series of reminder emails to you as the domain name approaches its expiry date. Make sure you whitelist those email address. If domain names are quite important register them for 5-10 years and lock all domain names.

Free POP3 server for personal use

My friend recently asked me a question:

Where can you find a free POP3 server?

POP3 has made earlier versions of the protocol obsolete. Generally you will not find a free POP3 server. Usually your ISP or webhosting company provides IMAP or POP3 access.

But where can get a free POP server?

You can use Google’s GMAIL service which provides a free POP3 service. You can download email using POP3 and send email using Googles SMTP server. According to Google:

POP, or Post Office Protocol, lets you download messages from Gmail’s servers onto your computer so you can access your mail with a program like Microsoft Outlook Express or Netscape Mail, even when you aren’t connected to the Internet.

POP access is free for all Gmail users and we have no plans to charge for it in the future.

Learn more about accessing your Gmail messages with POP

Free Download High resolution wallpapers for Windows, Linux and Mac OS X desktop

InterfaceLIFT website provides graphical user interface enhancements for Mac OS X, Microsoft Windows, and Linux.

You can download desktop wallpaper, icons, themes, and news with a focus on community. New content is posted virtually every day on this site.

All you have to do is visit their website

Select wallpaper

Select Size and click on download

You can view, sort or select wallpapers date wise or size wise. Currently they are offering 1,236 desktop backgrounds in widescreen and standard format for use with all operating systems. New wallpaper is posted daily!

Visit InterfaceLIFT website to pimp your desktop :)

C++ program to calculate tomorrow’s date

Q. How do I write C++ program that calculate tomorrow’s date? For example user input a date 30/03/2007, then it should print 31/03/2007. Your program must take care of following issues:
=> Leap year
=> Validate date for month, day etc
=> Change of date/month/year should be handled properly.
Continue reading “C++ program to calculate tomorrow’s date”

Howto connect MySQL PostgreSQL server to Microsoft Office Application using ODBC

Learn how to connect Microsoft application such as Excel and other to MySQL and PostgreSQL database server running on Linux. This is an excellent information / howto.

In cases where business applications have been built on open source databases, it may be necessary to connect other Windows applications, such as Microsoft Access or Excel, to these databases for reporting or business intelligence purposes.

One potential application of this process is to use Excel as a front-end for data analysis. Data can be pulled from views or tables and then further analyzed, graphed, and the like. Even pivot tables can be used to create even more powerful reporting solutions.

This how-to walks through this process using Excel as an example application. Although in this example, the MySQL and PostgreSQL servers are running on Linux, the steps are no different if the software is running on Windows. These steps are:
1. Setting up authentication
2. Installing the ODBC Drivers
3. Configuring the data source
4. Importing the data.

=> Connecting Office Applications to MySQL and PostgreSQL via ODBC

Free Fast Public DNS Servers List

The most basic task of DNS is to translate hostnames such as theos.in to IP address such as 74.86.49.131. In very simple terms, it can be compared to a phone book. DNS also has other important use such as email routing.

This is my list of better, fast public dns servers and free dns server (as compare to your ISP / DSL / ADSL / cable DNS service providers dns servers). These dns servers are free to all. I was able to improve my browsing speed with following DNS servers. Use any one of the following provider.

The most basic task of DNS is to translate hostnames such as theos.in to IP address such as 74.86.49.131. In very simple terms, it can be compared to a phone book. DNS also has other important use such as email routing.

This is my list of better, fast public dns servers and free dns server (as compare to your ISP / DSL / ADSL / cable DNS service providers dns servers). These dns servers are free to all. I was able to improve my browsing speed with following DNS servers. Use any one of the following provider.
Continue reading “Free Fast Public DNS Servers List”

20 most wanted Firefox extensions

There is a good list of 20 must-have Firefox extensions published at computer world web site. These plug-ins give you souped-up functionality, better look and feel, and streamlined development tasks.

Currently I am using following two add-ons
1) Google Toolbar
2) Stumble! Toolbar

You can find some other Firefox add-on information here :)

A freshly installed copy of Firefox is a great software package, but what makes this open-source browser so special is the ability to customize it via extensions and themes to really make it yours. The problem is, there are so many available add-ins, it’s tough to know what’s worth installing and what’s just going to junk up your system.
* Tools for taming the Web
* Visual improvements
* Matters of convenience
* Information gatherers
* Web developer essentials

=> 20 must-have Firefox extensions