Question

  Asked: Apr 11 2008   10:17 AM GMT
  Asked by: Jellybean


Lotus Script


LotusScript, RSS, Lotus Agents

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 retrueve 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

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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?
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Lotus Domino.

Looking for relevant Lotus Domino Whitepapers? Visit the SearchDomino.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Brooklynegg  |   Apr 11 2008  2:09PM GMT

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.

 

Jellybean  |   Apr 15 2008  2:56PM GMT

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??

 

Brooklynegg  |   Apr 16 2008  1:30PM GMT

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.

 

Jellybean  |   Apr 17 2008  1:17PM GMT

okey dokey, I’ll run it now on the server with Remote Debug & trap an errors.

 

Brooklynegg  |   Apr 17 2008  3:01PM GMT

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.