matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2016
07:55 PM
Little code help
EDIT: Not needed anymore. Please delete thread. There is no outcome to this thread. Changed code direction. Thx
Hello, just wondering why the below code will display the working url properly when going down the list, in that, if the first link fails, it will go to the next one, then if that one fails will go to the next one but the problem is that if the first url link is good, it still goes down the list and if the last link is bad then the whole code doesn't work.
*Note to self try:
If url <> "" then url = "http://myserver1.com/ececeec.txt" else url = "http://pastebin.com/raw/llwkkkcec"
If url <> "" then url = "http://myserver2.com/wecewce.txt" else url = "http://myserver1.com/ececeec.txt"
Hello, just wondering why the below code will display the working url properly when going down the list, in that, if the first link fails, it will go to the next one, then if that one fails will go to the next one but the problem is that if the first url link is good, it still goes down the list and if the last link is bad then the whole code doesn't work.
url = "http://pastebin.com/raw/llwkkkcec"
If url <> "" Then url = "http://myserver1.com/ececeec.txt"
If url <> "" Then url = "http://myserver2.com/wecewwe.txt"
IDArray = getStreamId(url)
*Note to self try:
If url <> "" then url = "http://myserver1.com/ececeec.txt" else url = "http://pastebin.com/raw/llwkkkcec"
If url <> "" then url = "http://myserver2.com/wecewce.txt" else url = "http://myserver1.com/ececeec.txt"
16 REPLIES 16
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016
11:27 AM
Re: Little code help
Good grief, no! You want to do something like this instead:
Except i am not quite sure what comes from getStreamId(), so it's up to you to figure out what the return is if download/parse had failed there. I remember there was recent conversation viewtopic.php?f=34&t=96627 and even went to check there but what do i see - you deleted the source from there because "I modified the code successfully"... apparently not though. Don't make our life hard here - this is a "free clinic" 😉
IDArray = getStreamId("http://pastebin.com/raw/llwkkkcec")
if idArray.count() < 1 then IDArray = getStreamId("http://myserver1.com/ececeec.txt")
if idArray.count() < 1 then IDArray = getStreamId("http://myserver2.com/wecewwe.txt")
Except i am not quite sure what comes from getStreamId(), so it's up to you to figure out what the return is if download/parse had failed there. I remember there was recent conversation viewtopic.php?f=34&t=96627 and even went to check there but what do i see - you deleted the source from there because "I modified the code successfully"... apparently not though. Don't make our life hard here - this is a "free clinic" 😉
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016
12:41 PM
Re: Little code help
not needed
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016
02:00 PM
Re: Little code help
not needed
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016
05:12 PM
Re: Little code help
Hello, it didn't work 😞 the second url link is a txt file because I don't know how to make it a raw file like the pastebin link so I have to make the code read the txt file and convert the contents to the url
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2016
08:02 AM
Re: Little code help
trying this code again but I don't know why the If <> "" doesn't work for when the url is invalid? it seems to read that line anyway
url = "http://pastebin.com/raw/llwkkkcec"
If url <> ""

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2016
09:20 AM
Re: Little code help
Your second line is asking if the url variable is equal to an empty string. It will NEVER be equal to an empty string, because you just set it to the "http..." string in the previous line. You don't want to be testing the url variable, you want to perform an http transfer from the server and see what comes back, like Enterr's code showed you. Your two line code is not touching any server at all, it's just setting a variable to a string and then checking whether that variable is still equal to the string.
--Mark
--Mark
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2016
09:51 AM
Re: Little code help
not needed

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2016
10:56 AM
Re: Little code help
If I'm understanding you correctly (though I'm not at all sure of that), you want to use roUrlTransfer.GetToString:
--Mark
xfer = CreateObject("roUrlTransfer")
xfer.SetURL(url)
new_url = xfer.GetToString()
--Mark
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2016
10:57 AM
Re: Little code help
not needed