FML2010
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2010
10:42 AM
send token on http post <solved> Thanks Chris!
i have tried everything to do this but im not having any luck here!!
what have I done wrong in this code below? it wont even load the app in my box when adding this and i cant figure out what i have done wrong, i have used the regScreen as a template to do this
also is it possible to add this to the appDetailsScreen , or maybe appHomeScreen so that it checks on another page outside the regScreen?
what have I done wrong in this code below? it wont even load the app in my box when adding this and i cant figure out what i have done wrong, i have used the regScreen as a template to do this
'***************************************************************
' Check user is paid or not and update registry
'***************************************************************
Function checkUserType(token As String) As String
token = RegRead("RegToken", "Authentication")
m.UrlBase = "http://XXXXXX.net/roku"
m.UrlGetUserInfo = m.UrlBase + "/accounts.php"
http = NewHttp(m.UrlGetUserInfo)
http.AddParam(" token", token)
while true
rsp = http.Http.GetToString()
xml = CreateObject("roXMLElement")
if not xml.Parse(rsp) then
print "Can't parse check User status"
ShowConnectionFailed()
return 2
endif
if xml.GetName() <> "result" then
print "unexpected check user status response: ", xml.GetName()
ShowConnectionFailed()
return 2
endif
if islist(xml.GetBody()) = true then
for each e in xml.GetBody()
if e.GetName() = "type" then
userType = e.GetBody()
RegWrite( "userType", userType)
else
return 3
endif
next
endif
end while
End Function
also is it possible to add this to the appDetailsScreen , or maybe appHomeScreen so that it checks on another page outside the regScreen?
8 REPLIES 8


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2010
07:21 PM
Re: send token on http post
Returning an integer from a function whose return type is a string is one problem I see right off. What kind of output are you seeing on the debug console?
FML2010
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2010
07:27 PM
Re: send token on http post
Chris your gonna love this response!!!
What do you mean debug console??
i am using notepad and my roku as testing nothing else!
What do you mean debug console??
i am using notepad and my roku as testing nothing else!


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2010
07:30 PM
Re: send token on http post
From section 8 of RokuDvp-DeveloperGuide.pdf
To access the debug console telnet to port 8085 on your box.
"RokuDvp-DeveloperGuide.pdf" wrote:
Using a standard shell program and a telnet client application, you can connect to the console for your application. The console provides you a window into the runtime environment for your application.
To access the debug console telnet to port 8085 on your box.
FML2010
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2010
07:38 PM
Re: send token on http post
all i can say is WOW!!!!!
weeks of posting on here and didnt know this!! Chris you have been very helpful!!
weeks of posting on here and didnt know this!! Chris you have been very helpful!!
EngoTom
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2010
10:11 PM
Re: send token on http post <solved> Thanks Chris!
Using the debug console and the Print statement is your friend when debugging for sure! The Stack Trace is also very helpful when you throw errors.
Question for ROKU. Does the Print statement affect performance? Should Print statements be commented out for a production build/release?
THX
Question for ROKU. Does the Print statement affect performance? Should Print statements be commented out for a production build/release?
THX

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2010
08:26 AM
Re: send token on http post
"FML2010" wrote:
all i can say is WOW!!!!!
weeks of posting on here and didnt know this!! Chris you have been very helpful!!
If you haven't already, you should probably read through the RokuDvp-DeveloperGuide.pdf that's included with the SDK. Section 8.0 covers debugging...
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
FML2010
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2010
09:35 AM
Re: send token on http post <solved> Thanks Chris!
Reading ALL those docs are a huge task!!
Everyone refers to them but sometimes they arent easy to understand and its easy to miss something or pass right over it.
so far the telnet has helped me a ton!! i have a laptop and a desktop on my desk so i can debug on one while working on the other and watching on the Tv
Everyone refers to them but sometimes they arent easy to understand and its easy to miss something or pass right over it.
so far the telnet has helped me a ton!! i have a laptop and a desktop on my desk so i can debug on one while working on the other and watching on the Tv

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2010
09:16 PM
Re: send token on http post <solved> Thanks Chris!
Yes. print statements can affect performance.
It's usually not noticeable for error conditions you'd like to keep track of when debugging your app, so no need to comment those out.
But if you are printing out every URL in your content list, those hundreds or thousands of print statements may very well lead to a slowdown that your users notice.
--Kevin
It's usually not noticeable for error conditions you'd like to keep track of when debugging your app, so no need to comment those out.
But if you are printing out every URL in your content list, those hundreds or thousands of print statements may very well lead to a slowdown that your users notice.
--Kevin