Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
mitchstein
Level 8

Simple http missing something...

request.SetMessagePort(port)
request.SetUrl("http://www.tvbydemand.com/video_update_views.asp?vpath=" & episode.url) (the error appears to be at the &)

what I'm trying to do is add code tothe sample player that will simply call up video_update_views.asp and pass the url of the video being played as "vpath"

there will be no return information back to the roku, just want to be able to update my videos in my database on my website.. figured this should be easy, but I'm missing something very simple.. (probably cause I've been working on this all night (31 hours straight without sleep)..
0 Kudos
5 Replies
RobSMS
Level 7

Re: Simple http missing something...

Get some sleep! lol

Try setting up your url before passing it to the .SetUrl and use a "+" instead of a "&"


url = http://www.tvbydemand.com/video_update_views.asp?vpath=" + episode.url
request.SetUrl(url)


You may also need to encode your episode.url depending on the characters contained within.
Need Apps Templates? Content Management for OTT/IPTV? Check me out @ http://rovidx.com
0 Kudos
belltown
Level 7

Re: Simple http missing something...

"mitchstein" wrote:
request.SetMessagePort(port)
request.SetUrl("http://www.tvbydemand.com/video_update_views.asp?vpath=" & episode.url) (the error appears to be at the &)

what I'm trying to do is add code tothe sample player that will simply call up video_update_views.asp and pass the url of the video being played as "vpath"

there will be no return information back to the roku, just want to be able to update my videos in my database on my website.. figured this should be easy, but I'm missing something very simple.. (probably cause I've been working on this all night (31 hours straight without sleep)..

This might work ('+' is the BrightScript string concatenation operator):
request.SetUrl("http://www.tvbydemand.com/video_update_views.asp?vpath=" + episode.url)

Although you might need to url-escape the query string, in which case try:
request.SetUrl("http://www.tvbydemand.com/video_update_views.asp?vpath=" + request.Escape(episode.url))


EDIT: Looks like Rob beat me to it.
https://github.com/belltown/
0 Kudos
mitchstein
Level 8

Re: Simple http missing something...

yep that should be it!! I was coding all day in asp using thisstring & thatstring... forgot in brightscript uses + instead of &.. duh.. and the escape is probably neccessary will let you know how I made out as soon as I get a chance to try it.. tonite though, sleep, just spent another 10 hours working on new asp code, lol.. thanx for the quick response though..
0 Kudos
mitchstein
Level 8

Re: Simple http missing something...

do I need to anything else in brisghtscript to execute the url, I do not need any displays (do not want it to display anything) just want to the vpath value to the asp page... like does it need a close statement or execute statement?
0 Kudos
belltown
Level 7

Re: Simple http missing something...

If you don't care about headers and response codes, then just call request.GetToString() after the call to SetUrl().
https://github.com/belltown/
0 Kudos