Foros del Web » Programando para Internet » Python »

array canal roku python

Estas en el tema de array canal roku python en el foro de Python en Foros del Web. perdon que publique aca no me deja publicar el la seccion python buenas tardes les comento que soy muy novato en python estoy armando un ...
  #1 (permalink)  
Antiguo 26/04/2017, 12:50
 
Fecha de Ingreso: noviembre-2015
Mensajes: 43
Antigüedad: 8 años, 5 meses
Puntos: 0
array canal roku python

perdon que publique aca no me deja publicar el la seccion python

buenas tardes les comento que soy muy novato en python estoy armando un canal

roku pero al agregar una categoria siempre me usa el mismo rss

http://xxx.xxx.xxx.xxx/testserie/house.rss

nesesito que al elegir twd use el rss
http://xxx.xxx.xxx.xxx/testserie/twdead.rss

muchas gracias y disculpen si no se entendio

sub RunUserInterface()
screen = CreateObject("roSGScreen")
scene = screen.CreateScene("HomeScene")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.Show()





LabelList = [
{title : "The Walking Dead"
urlrss : twd
}
{title : "Dr House"
urlrss : house
}
]
OptionsList = [{Title:"Reproducir"},
{Title:"Reproducir Todo"}]
scene.Content = ContentList2Node(GetApiArray())
scene.LabelContent = ContentList2Node(LabelList)
scene.OptionsContent = ContentList2Node(OptionsList)
while true
msg = wait(0, port)
print "------------------"
print "msg = "; msg
end while

if screen <> invalid then
screen.Close()
screen = invalid
end if

end sub


Function ParseXMLContent(list As Object)
RowItems = createObject("RoSGNode","ContentNode")

for each rowAA in list
row = ContentList2Node(rowAA.ContentList)
row.Title = rowAA.Title
RowItems.appendChild(row)
end for

return RowItems
End Function

function ContentList2Node(contentList as Object) as Object
result = createObject("roSGNode","ContentNode")

for each itemAA in contentList
item = createObject("roSGNode", "ContentNode")
item.SetFields(itemAA)
result.appendChild(item)
end for

return result
end function

Function GetApiArray()
url = CreateObject("roUrlTransfer")
url.SetUrl("http://xxx.xxx.xxx.xxx/testserie/" + (urlrss) + ".rss")
rsp = url.GetToString()

responseXML = ParseXML(rsp)
If responseXML <> invalid then
responseXML = responseXML.GetChildElements()
responseArray = responseXML.GetChildElements()
End if

result = []

for each xmlItem in responseArray
if xmlItem.getName() = "item"
itemAA = xmlItem.GetChildElements()
if itemAA <> invalid
item = {}
for each xmlItem in itemAA
item[xmlItem.getName()] = xmlItem.getText()
if xmlItem.getName() = "media:content"
item.stream = {url : xmlItem.url}
item.url = xmlItem.getAttributes().url
item.streamFormat = xmlItem.getAttributes().url
mediaContent = xmlItem.GetChildElements()
for each mediaContentItem in mediaContent
if mediaContentItem.getName() = "media:thumbnail"
item.HDPosterUrl = mediaContentItem.getattributes().url
item.hdBackgroundImageUrl = mediaContentItem.getattributes().url
end if
end for
end if
end for
result.push(item)
end if
end if
end for

return result
End Function


Function ParseXML(str As String) As dynamic
if str = invalid return invalid
xml = CreateObject("roXMLElement")
if not xml.Parse(str) return invalid
return xml
End Function
  #2 (permalink)  
Antiguo 26/04/2017, 12:59
 
Fecha de Ingreso: noviembre-2003
Ubicación: Zaragoza, España
Mensajes: 1.257
Antigüedad: 20 años, 5 meses
Puntos: 154
Respuesta: array canal roku python

Hola narusuke,

¿Seguro que no te deja publicar aquí?

Aparte, el código se lee mejor si utilizas el correspondiente highlight para presentarlo.
  #3 (permalink)  
Antiguo 26/04/2017, 13:02
 
Fecha de Ingreso: noviembre-2015
Mensajes: 43
Antigüedad: 8 años, 5 meses
Puntos: 0
Respuesta: array canal roku python

Cita:
Iniciado por rbczgz Ver Mensaje
Hola narusuke,

¿Seguro que no te deja publicar aquí?

Aparte, el código se lee mejor si utilizas el correspondiente highlight para presentarlo.

hola si no se porque no me deja y no me di cuenta lo del highlight perdon

Etiquetas: php, url
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:05.