Lotus Script: Running an agent that updates RSS feeds

405 pts.
Tags:
Lotus Agents
LotusScript
RSS
HI, I am running an agent that updates my RSS feeds. When I run it locally it runs fine but when I schedule it to run on our server it doesn't retrieve anything from the Web, help!
CODE Sub GetnUpdateFeed(Document As NotesDocument) On Error Goto errGetnUpdateFeed Dim strtext As String Dim session As New NotesSession Set richStyle = session.CreateRichTextStyle Dim richText As New NotesRichTextItem(document, "BODY") richStyle.PassThruHTML = True Call richText.AppendStyle(richStyle) Dim XMLDOC As Variant Set xmlDoc=CreateObject("Msxml2.DOMDocument.4.0") xmlDoc.async="false" url=document.GetItemValue(|RSS_Feed_URL|) strtitle=document.GetItemValue(|Subject|) Dim TitleString As String, GoogleString As String Dim positionOfChar As Long If Trim(url(0))="" Then Exit Sub xmldoc.load(url(0)) xpathtitle="/rss/channel/item/title" Set nodes_title=xmlDoc.selectNodes(xpathtitle) xpathlink="/rss/channel/item/link" Set nodes_link=xmlDoc.selectNodes(xpathlink) xpathdescription="/rss/channel/item/description" Set nodes_description=xmlDoc.selectNodes(xpathdescription) Forall x In nodes_title v = v + 1 'Print "V = " & V 'If positionOfChar& = 0 Then ' Call richText.AppendText(Cstr(v) + ". " + x.text) Call richtext.AddNewline(1) 'End If p=0 Forall b In nodes_link p=p+1 'Print "P = " & P If p=v Then Call richtext.AddTab(1) 'If positionOfChar& =0 Then ' Call richText.AppendText(b.text) 'End If Call richtext.AddNewline(1) g=0 Forall e In nodes_description g=g+1 'Print "G = " & G If g=v Then Call richtext.AddTab(2) Call richText.AppendText(e.text) 'Print "Just written e.text" Call richtext.AddNewline(2) Exit Forall End If End Forall Exit Forall End If End Forall 'Print "RSS-Saving document" Call document.save(True,False) End Forall 'Print "AT BOTTOM OF FOALL" Exit Sub errGetnUpdateFeed: 'Print "Sub errGetnUpdateFeed - Error " & Err() & ": " & Error() & "Erl:" & Erl() Resume Next End Sub
ASKED: April 11, 2008  10:17 AM
UPDATED: June 27, 2013  7:29 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

When it’s scheduled, what’s the value of Document that is passed in? How is it passed in?
How do you know what line is causing the problem?
What ID is used to run the agent when scheduled? Does it have the proper rights?

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Brooklynegg
    I don't see anything immediately. Take the apostrophe off the Print line in the errGetUpdateFeed goto tag. Run the code. Look to the server log.nsf to see what error is printed. Let me know what you get.
    3,845 pointsBadges:
    report
  • Jellybean
    I would but no error relevant is raised, The issue is with the line; xmldoc.load(url(0)) This should return the XML but returns nothing??
    405 pointsBadges:
    report
  • Brooklynegg
    You are creating an object. The application that supports this type of object is on your local machine, but is not on the server. What kind of object is a "Msxml2.DOMDocument.4.0". Also, you said that no relevant error is raised. That is a mistake. Share the error so we can determine whether it is relevant.
    3,845 pointsBadges:
    report
  • Jellybean
    okey dokey, I'll run it now on the server with Remote Debug & trap an errors.
    405 pointsBadges:
    report
  • Brooklynegg
    If you've used remote debug before, then that's fine. I tried it once and all the stops that we never commented out in code almost killed us. We couldn't use it in our environment without a complete review of every bit of code.
    3,845 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following