Re: Rss feed issue

2006-04-24 Thread Rob Wilkerson
You didn't give us much to work with.  Looks like the problem is
inside your component.  The feed URL seems to work okay.

On 4/24/06, Eric J. Hoffman [EMAIL PROTECTED] wrote:
 All our news feeds were working earlier today, and suddenly they went
 kaput.  The feeds are up if I go directly to them.

 Cfcatch just tells me:  java.lang.NullPointerException

 Here's the code...but I can't figure out what the next step is

 cftry
 cfinvoke component=GetNewsFeed method=getheadlines
 returnVariable=newsfeed
 url=http://p.moreover.com/cgi-local/page?c=GMO%20newso=rss002;
 type=Rss

 cfif IsQuery(Newsfeed)
  P
cfoutput
font size=26 of #newsfeed.recordcount# articles
 displayed.brbr
/cfoutput
 cfoutput query=newsfeed maxrows=6
   a href=#link# target=_blank#title#/abr
  #left(description,150)#brbr
 /cfoutput
   /P/font
 cfelse
   An error occured.br
   cfoutput#newsfeed#/cfoutput
 /cfif
 cfcatch type=any
 cfoutput
 #cfcatch.Detail#br /

 #cfcatch.Message#br /
 #cfcatch.Type#br /

 News is unavailable.
 /cfoutput
 /cfcatch
 /cftry

 Thanks!
 


 Eric J. Hoffman
 Managing Partner
 2081 Industrial Blvd
 StillwaterMN55082
 mail: [EMAIL PROTECTED]
 www: http://www.ejhassociates.com
 tel: 651.717.4105
 fax: 651.717.4115
 mob: 651.245.2717

 

 This message contains confidential information and is intended only for 
 [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not 
 disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] 
 immediately by e-mail if you have received this e-mail by mistake and delete 
 this e-mail from your system. E-mail transmission cannot be guaranteed to be 
 secure or error-free as information could be intercepted, corrupted, lost, 
 destroyed, arrive late or incomplete, or contain viruses. Eric J. Hoffman 
 therefore does not accept liability for any errors or omissions in the 
 contents of this message, which arise as a result of e-mail transmission. If 
 verification is required please request a hard-copy version.
 

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238529
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Rss feed issue

2006-04-24 Thread Eric J. Hoffman
Oh, this is from somewhere...the component I should say.  I don't need
to do anything funky to get a component to get rolling, do I?  Here is
the script:

!--

NAME:   GetNewsFeed
FILE:   GetNewsFeed.cfc
CREATED: 01/09/2003
MODIFIED:04/20/2003
VERSION: 1.1

AUTHOR: Ian Mitchell ([EMAIL PROTECTED])

DESCRIPTION:This CFC uses CFHTTP to retrieve an XML news feed from
any RSS or RDF standard newsfeed.  The XML file is then
parsed into
a CF query object.  

ARGUMENTS:  url:   URL of the newsfeed to grab
type:  RDF or RSS
   RDF handles RDF 1.0 standard news feeds
   RSS handls RSS 0.91 standard news feeds
   Both formats are locatable on Netscapes
website.

RETURNS:Returns False if any errors occur, otherwise a query
with the 
following structure is returned:
title   
string containing the title of an
article
description
string containing the description of an
article
link
URL to the article
KNOWN ISSUES:   You should first test the query returned with an IsQuery
in
case an error is returned.


---

cfcomponent   
  cffunction name=GetHeadlines access=public output=True

cfargument name=url type=string required=true/
cfargument name=type type=string required=true/

  cfhttp url=#arguments.url#/
  cfscript
try {
  switch(trim(lcase(arguments.type))) {
case 'rdf':
  selectedElements = XmlSearch(xmlparse(cfhttp.filecontent),
/rdf:RDF/:item);
  break;
case 'rss':
  selectedElements = XmlSearch(xmlparse(cfhttp.filecontent),
/rss/channel/item);
  break;
default:
  return false;
  break;
  }
  articles = QueryNew(title, link, description);
  for(index = 1;index lt ArrayLen(selectedElements);index = index +
1) {
QueryAddRow(articles);
 
QuerySetCell(articles,title,selectedElements[index].title.XmlText);
 
QuerySetCell(articles,link,selectedElements[index].link.XmlText);
 
QuerySetCell(articles,description,selectedElements[index].description.
XmlText);
  }
} catch(Any excpt) {
  return excpt.Message;
}
/cfscript

cfreturn articles/

  /cffunction
/cfcomponent





Eric J. Hoffman
Managing Partner
2081 Industrial Blvd
StillwaterMN55082
mail: [EMAIL PROTECTED]
www: http://www.ejhassociates.com
tel: 651.717.4105
fax: 651.717.4115
mob: 651.245.2717



This message contains confidential information and is intended only for [EMAIL 
PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, 
distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by 
e-mail if you have received this e-mail by mistake and delete this e-mail from 
your system. E-mail transmission cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses. Eric J. Hoffman therefore does 
not accept liability for any errors or omissions in the contents of this 
message, which arise as a result of e-mail transmission. If verification is 
required please request a hard-copy version.


-Original Message-

From: Rob Wilkerson [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 24, 2006 11:09 AM
To: CF-Talk
Subject: Re: Rss feed issue

You didn't give us much to work with.  Looks like the problem is inside
your component.  The feed URL seems to work okay.

On 4/24/06, Eric J. Hoffman [EMAIL PROTECTED] wrote:
 All our news feeds were working earlier today, and suddenly they went 
 kaput.  The feeds are up if I go directly to them.

 Cfcatch just tells me:  java.lang.NullPointerException

 Here's the code...but I can't figure out what the next step is

 cftry
 cfinvoke component=GetNewsFeed method=getheadlines
 returnVariable=newsfeed
 url=http://p.moreover.com/cgi-local/page?c=GMO%20newso=rss002;
 type=Rss

 cfif IsQuery(Newsfeed)
  P
cfoutput
font size=26 of #newsfeed.recordcount# articles 
 displayed.brbr
/cfoutput
 cfoutput query=newsfeed maxrows=6
   a href=#link# target=_blank#title#/abr
  #left(description,150)#brbr
 /cfoutput
   /P/font
 cfelse
   An error occured.br
   cfoutput#newsfeed#/cfoutput
 /cfif
 cfcatch type=any
 cfoutput
 #cfcatch.Detail#br /

 #cfcatch.Message#br /
 #cfcatch.Type#br /

 News

Re: Rss feed issue

2006-04-24 Thread Rob Wilkerson
Not sure what to tell you.  I usually get null pointer exceptions when
the constructor for a custom java class fails.  My first thought would
be that something changed in the feed definition XML and maybe it's
throwing off the selected items.  Clearly something changed between
the time it worked and the time it stopped working.  If you didn't
change any code then the best guess might be the feed itself.

Is there any way to investigate that?

On 4/24/06, Eric J. Hoffman [EMAIL PROTECTED] wrote:
 Oh, this is from somewhere...the component I should say.  I don't need
 to do anything funky to get a component to get rolling, do I?  Here is
 the script:

 !--
 
 NAME:   GetNewsFeed
 FILE:   GetNewsFeed.cfc
 CREATED: 01/09/2003
 MODIFIED:04/20/2003
 VERSION: 1.1

 AUTHOR: Ian Mitchell ([EMAIL PROTECTED])

 DESCRIPTION:This CFC uses CFHTTP to retrieve an XML news feed from
 any RSS or RDF standard newsfeed.  The XML file is then
 parsed into
 a CF query object.

 ARGUMENTS:  url:   URL of the newsfeed to grab
 type:  RDF or RSS
RDF handles RDF 1.0 standard news feeds
RSS handls RSS 0.91 standard news feeds
Both formats are locatable on Netscapes
 website.

 RETURNS:Returns False if any errors occur, otherwise a query
 with the
 following structure is returned:
 title
 string containing the title of an
 article
 description
 string containing the description of an
 article
 link
 URL to the article
 KNOWN ISSUES:   You should first test the query returned with an IsQuery
 in
 case an error is returned.

 
 ---

 cfcomponent
   cffunction name=GetHeadlines access=public output=True

 cfargument name=url type=string required=true/
 cfargument name=type type=string required=true/

   cfhttp url=#arguments.url#/
   cfscript
 try {
   switch(trim(lcase(arguments.type))) {
 case 'rdf':
   selectedElements = XmlSearch(xmlparse(cfhttp.filecontent),
 /rdf:RDF/:item);
   break;
 case 'rss':
   selectedElements = XmlSearch(xmlparse(cfhttp.filecontent),
 /rss/channel/item);
   break;
 default:
   return false;
   break;
   }
   articles = QueryNew(title, link, description);
   for(index = 1;index lt ArrayLen(selectedElements);index = index +
 1) {
 QueryAddRow(articles);

 QuerySetCell(articles,title,selectedElements[index].title.XmlText);

 QuerySetCell(articles,link,selectedElements[index].link.XmlText);

 QuerySetCell(articles,description,selectedElements[index].description.
 XmlText);
   }
 } catch(Any excpt) {
   return excpt.Message;
 }
 /cfscript

 cfreturn articles/

   /cffunction
 /cfcomponent


 


 Eric J. Hoffman
 Managing Partner
 2081 Industrial Blvd
 StillwaterMN55082
 mail: [EMAIL PROTECTED]
 www: http://www.ejhassociates.com
 tel: 651.717.4105
 fax: 651.717.4115
 mob: 651.245.2717

 

 This message contains confidential information and is intended only for 
 [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not 
 disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] 
 immediately by e-mail if you have received this e-mail by mistake and delete 
 this e-mail from your system. E-mail transmission cannot be guaranteed to be 
 secure or error-free as information could be intercepted, corrupted, lost, 
 destroyed, arrive late or incomplete, or contain viruses. Eric J. Hoffman 
 therefore does not accept liability for any errors or omissions in the 
 contents of this message, which arise as a result of e-mail transmission. If 
 verification is required please request a hard-copy version.
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238551
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Rss feed issue

2006-04-24 Thread Rob Wilkerson
Another thought might be that the descriptions (titles, too) within
the feed do not appear to be in a CDATA block.  If there are invalid
characters in there then that might affect how the XML is processed.

Just a thought.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238553
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Rss feed issue

2006-04-24 Thread Eric J. Hoffman
I will try, and will clear the template cache, etc etc.   There are two
feeds, and both are broke, so it must be on my end. 





Eric J. Hoffman
Managing Partner
2081 Industrial Blvd
StillwaterMN55082
mail: [EMAIL PROTECTED]
www: http://www.ejhassociates.com
tel: 651.717.4105
fax: 651.717.4115
mob: 651.245.2717



This message contains confidential information and is intended only for [EMAIL 
PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, 
distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by 
e-mail if you have received this e-mail by mistake and delete this e-mail from 
your system. E-mail transmission cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses. Eric J. Hoffman therefore does 
not accept liability for any errors or omissions in the contents of this 
message, which arise as a result of e-mail transmission. If verification is 
required please request a hard-copy version.


-Original Message-

From: Rob Wilkerson [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 24, 2006 2:13 PM
To: CF-Talk
Subject: Re: Rss feed issue

Not sure what to tell you.  I usually get null pointer exceptions when
the constructor for a custom java class fails.  My first thought would
be that something changed in the feed definition XML and maybe it's
throwing off the selected items.  Clearly something changed between the
time it worked and the time it stopped working.  If you didn't change
any code then the best guess might be the feed itself.

Is there any way to investigate that?

On 4/24/06, Eric J. Hoffman [EMAIL PROTECTED] wrote:
 Oh, this is from somewhere...the component I should say.  I don't need

 to do anything funky to get a component to get rolling, do I?  Here is

 the script:

 !
 --
 
 NAME:   GetNewsFeed
 FILE:   GetNewsFeed.cfc
 CREATED: 01/09/2003
 MODIFIED:04/20/2003
 VERSION: 1.1

 AUTHOR: Ian Mitchell ([EMAIL PROTECTED])

 DESCRIPTION:This CFC uses CFHTTP to retrieve an XML news feed from
 any RSS or RDF standard newsfeed.  The XML file is 
 then parsed into
 a CF query object.

 ARGUMENTS:  url:   URL of the newsfeed to grab
 type:  RDF or RSS
RDF handles RDF 1.0 standard news feeds
RSS handls RSS 0.91 standard news feeds
Both formats are locatable on Netscapes 
 website.

 RETURNS:Returns False if any errors occur, otherwise a query
 with the
 following structure is returned:
 title
 string containing the title of an 
 article
 description
 string containing the description of 
 an article
 link
 URL to the article
 KNOWN ISSUES:   You should first test the query returned with an
IsQuery
 in
 case an error is returned.

 --
 --
 ---

 cfcomponent
   cffunction name=GetHeadlines access=public output=True

 cfargument name=url type=string required=true/
 cfargument name=type type=string required=true/

   cfhttp url=#arguments.url#/
   cfscript
 try {
   switch(trim(lcase(arguments.type))) {
 case 'rdf':
   selectedElements = XmlSearch(xmlparse(cfhttp.filecontent),
 /rdf:RDF/:item);
   break;
 case 'rss':
   selectedElements = XmlSearch(xmlparse(cfhttp.filecontent),
 /rss/channel/item);
   break;
 default:
   return false;
   break;
   }
   articles = QueryNew(title, link, description);
   for(index = 1;index lt ArrayLen(selectedElements);index = index 
 +
 1) {
 QueryAddRow(articles);

 QuerySetCell(articles,title,selectedElements[index].title.XmlText);

 QuerySetCell(articles,link,selectedElements[index].link.XmlText);


QuerySetCell(articles,description,selectedElements[index].description.
 XmlText);
   }
 } catch(Any excpt) {
   return excpt.Message;
 }
 /cfscript

 cfreturn articles/

   /cffunction
 /cfcomponent


 


 Eric J. Hoffman
 Managing Partner
 2081 Industrial Blvd
 StillwaterMN55082
 mail: [EMAIL PROTECTED]
 www: http://www.ejhassociates.com
 tel: 651.717.4105
 fax: 651.717.4115
 mob: 651.245.2717

 

 This message contains confidential information and is intended only