2006-11-08, 23:16
ok i already made a request for a script like this
but nobody responded so i tried some stuff myself
link to my topic: http://forum.xbmc.org/showthread.php?tid=23023
i cant write python but i can write php. But they have a lot in comon.
this is my proof of concept that it works (in windows)
there is no error detection and it just displays the link to the file.
the comments are in dutch but the code is easy to read
But I dont know anything about gui's
some help?
but nobody responded so i tried some stuff myself
link to my topic: http://forum.xbmc.org/showthread.php?tid=23023
i cant write python but i can write php. But they have a lot in comon.
this is my proof of concept that it works (in windows)
there is no error detection and it just displays the link to the file.
the comments are in dutch but the code is easy to read
Code:
import urllib,urllib2 , re
import time
from string import split, replace, find, capitalize, join
# om strings te capitalisen
def capitalize_words(s):
s = split(s)
for i in range(len(s)):
s[i] = capitalize(s[i])
return join(s)
# imput van dingen
Artist = raw_input("Artist = ")
Song = raw_input("Song = ")
# Voor de url
ArtistTemp = Artist.lower()
ArtistTemp = replace( ArtistTemp, " ", "_")
print ArtistTemp
URL = "http://radioblogclub.com/search/0/" + ArtistTemp
del ArtistTemp
WebSock = urllib.urlopen(URL) # Opens a 'Socket' to URL
HTML = WebSock.read() # Reads Contents of URL and saves to Variable
WebSock.close() # Closes connection to url
# Doorlees HTML
spam = capitalize_words(Song)
Result = re.compile("blogThis[(]['](.*)" + spam +".rbs").findall(HTML)
# Verwerking
test = Result[0] + spam + ".rbs"
# Output
print test
But I dont know anything about gui's
some help?