Click here to Skip to main content
15,884,176 members
Articles / Desktop Programming / WTL

RSS Reader Plug-in for Internet Explorer

Rate me:
Please Sign up or sign in to vote.
5.00/5 (12 votes)
16 Jul 2007CPOL4 min read 317.3K   1.3K   32  
This is a toolbar for the Internet Explorer which shows information from RSS taken from the Internet.
/*
	Project		: RSS Reader plugin for Internet Explorer
	File Name	: RRPRssItem.cpp
	Date		: 
	Purpose		: It encapsulates RSS Item information
	Note		: Used by RRPRssParser
	Send comments 
	or Bugs to	: prafulla_t@users.sourceforge.net
*/

#include "StdAfx.h"
#include "RRPRssItem.h"

RRPRssItem::RRPRssItem(void) {
	title = NULL;
	description = NULL;
	link = NULL;
}

RRPRssItem::~RRPRssItem(void) {
	if(title)
		delete title;
	if(description)
		delete description;
	if(link)
		delete link;
}

CString RRPRssItem::removeTags(CString html,BOOL &hasImage,BOOL &hasTable)
{
	CString temp;
	int flag;
	BOOL img=false;
	BOOL table=false;
	for(int i=0;i<html.GetLength();i++)
	{
		flag=0;
		if(html.GetAt(i)=='<')
			while(html.GetAt(i)!='>')
			{
				if(html.GetAt(i)=='<' && html.GetAt(i+1)=='i' && html.GetAt(i+2)=='m' && html.GetAt(i+3)=='g')
					img=true;
				if(html.GetAt(i)=='<' && html.GetAt(i+1)=='t' && html.GetAt(i+2)=='a' && html.GetAt(i+3)=='b' && html.GetAt(i+4)=='l' && html.GetAt(i+5)=='e')
					table=true;
			
				flag=1;
				i++;
			}
		if(flag)
		{
			if(html.GetLength()==(i+1))
				break;
			else
			{
				if(html[i]!='>')
					i++;
			}
		}
		if(html.GetAt(i) != '>')
			temp += html.GetAt(i);
	}
	hasImage=img;
	hasTable=table;
	temp.TrimLeft();
	temp.TrimRight();
	return removeSpaces(temp);
}

CString RRPRssItem::removeSpaces(CString str)
{
	CString temp;
	for(int i=0;i<str.GetLength();i++)
	{
		if(str.GetAt(i)==' ')
		{
			temp += ' ';
			while(str.GetAt(i)==' ')
				i++;
		}
		temp += str.GetAt(i);
	}
	return temp;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
Quote : "Life is all about solving problems and enjoying their solutions !! "

Comments and Discussions