Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
squirreltown
Roku Guru

Re: RSS parse

yea I actually got that part right this time. This same function works fine if I change the POST stuff to GET, which is the way it is normally.

Ive just changed
m.http.SetUrl(feed_url)

to
strx = ReadAsciiFile("tmp:/apfavorites")
m.http.SetUrl(feed_url)
m.http.AsyncPostFromString("AID=" + strx)

and
xml=m.http.GetToString()

to

while true
msg = Wait(8000, m.port )
If msg = invalid Then
print "Error: invalid"
Else If Type( msg ) = "roUrlEvent" Then
if msg.GetString()
xml= msg.GetString()
End If
end if

...............


it prints the error and crashes on the next block because the xml variable is empty
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: RSS parse

"squirreltown" wrote:
yea I actually got that part right this time. This same function works fine if I change the POST stuff to GET, which is the way it is normally.

Ive just changed
m.http.SetUrl(feed_url)

to
strx = ReadAsciiFile("tmp:/apfavorites")
m.http.SetUrl(feed_url)
m.http.AsyncPostFromString("AID=" + strx)

and
xml=m.http.GetToString()

to

while true
msg = Wait(8000, m.port )
If msg = invalid Then
print "Error: invalid"
Else If Type( msg ) = "roUrlEvent" Then
if msg.GetString()
xml= msg.GetString()
End If
end if

...............


it prints the error and crashes on the next block because the xml variable is empty

That's actually a much bigger change that it may look. You went from the synchronous GetToString() to the asynchronous AsycnPostFromString() method. The former doesn't require a port and wait loop, while the second does, so I'd bet it is an issue with the port you're listening on. Try just swapping:
xml = m.http.GetToString()
with:
xml = m.http.PostFromString("AID=" + strx)
and see if it works. That's swapping synchronous for synchronous...
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: RSS parse

Thank you TheEndless & Mark- So it turns out to be a port issue after all. I thought the port was being set in the function that created it but i guess not. I added a setmessageport line and that led to it getting fixed, it runs fine now.
Kinetics Screensavers
0 Kudos
mushiidoger
Visitor

Re: RSS parse

hello
i want to send username and password in post form
i not found any right way to do it kindly help me.
i have username in one variable and password in other variable
and i have url so how i send request to the server in post form
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.