I use the default skin supplied with the download.
I have not yet worked with categories. Another thing to learn
Thank you.
Tkn2 = Mid(Tkn,Pos_Left+1,Pos_Right-Pos_Left-2)
Windows Script Host
Script: C:\shoutcast\Shoutcast_to_Xml.vbs
Line: 241
Char: 2
Error: Invalid procedure call or argument: 'Mid'
Code: 800A0005
Source: Microsoft VBScript runtime error
Marbles_00 wrote:
*EDIT 30/5/07*
Whoop....hold on! I just tried it on a different computer (running Win2k like the machine I was running at home) and the .vbs file worked. So it must be something to do with my setup and not the .vbs file itself. Sorry to have bothered you.
Marbles_00 wrote: but since xshoutcast does not work anymore
surely theres somebody with coding skills and shoutcast familiarity outthere... he/she could also include shoutcast telly
public void RefreshDatabase()
{
XmlTextReader reader = new XmlTextReader(this.myPath + @"\plugins\XShoutcast.xml");
string[] textArray = new string[30];
int index = 0;
int num2 = 0;
int num3 = 40;
string filename = "";
int num4 = 0;
this.XProcessStatus = "Reading config...";
int num5 = 0;
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
if (reader.Name == "Genre")
{
reader.Read();
textArray[index] = reader.Value.ToString();
index++;
}
if (reader.Name == "MinBitrate")
{
reader.Read();
if (reader.Value == "all")
{
num2 = 0;
}
else
{
num2 = Convert.ToInt16(reader.Value);
}
}
if (reader.Name == "MaxStationsPerGenre")
{
reader.Read();
num3 = Convert.ToInt16(reader.Value);
}
if (reader.Name == "Database")
{
reader.Read();
filename = reader.Value;
}
if (reader.Name == "DatabaseFormat")
{
reader.Read();
if (reader.Value == "OneLevel")
{
num4 = 0;
}
if (reader.Value == "TwoLevels")
{
num4 = 1;
}
}
}
}
reader.Close();
try
{
int num6 = 0;
string requestUriString = "";
int num7 = 0;
XmlDocument document = new XmlDocument();
document.CreateNode(XmlNodeType.XmlDeclaration, "", "");
XmlNode newChild = document.CreateNode(XmlNodeType.XmlDeclaration, "", "");
document.AppendChild(newChild);
XmlElement element = document.CreateElement("", "database", "");
XmlElement element5 = document.CreateElement("", "sortorder", "");
XmlText text3 = document.CreateTextNode("display");
element5.AppendChild(text3);
element.AppendChild(element5);
for (num6 = 0; num6 < index; num6++)
{
this.XProcessStatus = "Processing Genre: " + textArray[num6] + " ...";
XmlElement elementById = document.GetElementById("sortorder");
XmlElement element4 = document.GetElementById("sortorder");
num7 = 0;
if (num4 == 1)
{
XmlElement element2 = document.CreateElement("", "display", "");
text3 = document.CreateTextNode(textArray[num6]);
element2.AppendChild(text3);
elementById = document.CreateElement("", "item", "");
elementById.AppendChild(element2);
element4 = document.CreateElement("", "subitems", "");
}
for (int i = 0; i < (num3 / 20); i++)
{
if (i == 0)
{
requestUriString = "http://www.shoutcast.com/directory/index.phtml?sgenre=" + textArray[num6];
}
else
{
string text4 = Convert.ToString((int) (i * 20)) + "&sgenre=" + textArray[num6];
requestUriString = "http://www.shoutcast.com/directory/index.phtml?startat=" + text4;
}
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
request.Timeout = 0x1388;
request.UserAgent = "Code Sample Web Client";
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
Encoding encoding = Encoding.GetEncoding(0x4e4);
StreamReader reader2 = new StreamReader(response.GetResponseStream(), encoding);
int num9 = 0;
int num10 = -500;
int num11 = 7;
int num12 = 0;
string text = "";
string text6 = "";
string text7 = "";
bool flag = false;
while (!reader2.EndOfStream)
{
num9++;
string text8 = reader2.ReadLine();
flag = false;
if (text8.LastIndexOf("file=filename") > 0)
{
string text9 = text8.Substring(text8.IndexOf("<a href=") + 9, (text8.IndexOf("filename.pls") - text8.IndexOf("<a href=")) + 3);
text = "http://www.shoutcast.com" + text9;
num10 = num9;
}
if (text8.LastIndexOf("_scurl") > 0)
{
text6 = text8.Substring(text8.IndexOf("[") + 1, (text8.IndexOf("]") - text8.IndexOf("[")) - 1);
string text10 = text8.Remove(text8.LastIndexOf("</a>"));
text7 = text10.Substring(text10.LastIndexOf(">") + 1);
}
if (num9 == (num10 + 3))
{
if (text8.LastIndexOf("Now Playing:") > 0)
{
num11 = 7;
}
else
{
num11 = 6;
}
}
if (num9 == (num10 + num11))
{
string text11 = text8.Remove(text8.LastIndexOf("</font>"));
num12 = Convert.ToInt16(text11.Substring(text11.LastIndexOf(">") + 1));
flag = true;
num10 = 0;
}
if (flag && (num12 >= num2))
{
XmlElement element6;
XmlElement element7;
XmlElement element8;
num7++;
num5++;
this.XProcessStatus = "Processing Genre: " + textArray[num6] + " (found:" + Convert.ToString(num7) + ")";
switch (num4)
{
case 0:
element6 = document.CreateElement("", "item", "");
element7 = document.CreateElement("", "parameter", "");
text3 = document.CreateTextNode(text);
element7.AppendChild(text3);
element6.AppendChild(element7);
element7 = document.CreateElement("", "display", "");
text3 = document.CreateTextNode(text7);
element7.AppendChild(text3);
element6.AppendChild(element7);
element7 = document.CreateElement("", "type", "");
text3 = document.CreateTextNode("track");
element7.AppendChild(text3);
element6.AppendChild(element7);
element7 = document.CreateElement("", "information", "");
element8 = document.CreateElement("", "trackgenre", "");
text3 = document.CreateTextNode(textArray[num6]);
element8.AppendChild(text3);
element7.AppendChild(element8);
element8 = document.CreateElement("", "trackbitrate", "");
text3 = document.CreateTextNode(Convert.ToString(num12));
element8.AppendChild(text3);
element7.AppendChild(element8);
element8 = document.CreateElement("", "trackname", "");
text3 = document.CreateTextNode(text6);
element8.AppendChild(text3);
element7.AppendChild(element8);
element8 = document.CreateElement("", "trackposition", "");
text3 = document.CreateTextNode(Convert.ToString(num7));
element8.AppendChild(text3);
element7.AppendChild(element8);
element6.AppendChild(element7);
element.AppendChild(element6);
break;
case 1:
element6 = document.CreateElement("", "item", "");
element7 = document.CreateElement("", "parameter", "");
text3 = document.CreateTextNode(text);
element7.AppendChild(text3);
element6.AppendChild(element7);
element7 = document.CreateElement("", "display", "");
text3 = document.CreateTextNode(text7);
element7.AppendChild(text3);
element6.AppendChild(element7);
element7 = document.CreateElement("", "type", "");
text3 = document.CreateTextNode("track");
element7.AppendChild(text3);
element6.AppendChild(element7);
element7 = document.CreateElement("", "information", "");
element8 = document.CreateElement("", "trackgenre", "");
text3 = document.CreateTextNode(textArray[num6]);
element8.AppendChild(text3);
element7.AppendChild(element8);
element8 = document.CreateElement("", "trackbitrate", "");
text3 = document.CreateTextNode(Convert.ToString(num12));
element8.AppendChild(text3);
element7.AppendChild(element8);
element8 = document.CreateElement("", "trackname", "");
text3 = document.CreateTextNode(text6);
element8.AppendChild(text3);
element7.AppendChild(element8);
element8 = document.CreateElement("", "trackposition", "");
text3 = document.CreateTextNode(Convert.ToString(num7));
element8.AppendChild(text3);
element7.AppendChild(element8);
element6.AppendChild(element7);
element4.AppendChild(element6);
break;
}
}
}
response.Close();
reader2.Close();
}
if ((num4 == 1) && (num7 != 0))
{
elementById.AppendChild(element4);
element.AppendChild(elementById);
}
}
document.AppendChild(element);
this.XProcessStatus = "Found " + Convert.ToString(num5) + " Stations !";
document.Save(filename);
}
catch
{
}
}