@ref 'System.Xml'
use System.Xml.Linq
class Program
def main
showname = 'Californication'
xml = XDocument.load('http://www.tvrage.com/feeds/episode_list.php?show=[showname]')
print xml.element('show')
I get the following error running this code
TVRage.cobra(9): error: Argument 1 of method "element" expects type XName?, but the call is supplying type String.
Compilation failed - 1 error, 0 warnings
Not running due to errors above.
However, you cannot create an Xname, and in C#, you simply supply a string to the method 'Element', like so
- Code: Select all
using System;
using System.Xml.Linq;
namespace TVRage
{
class Program
{
static void Main(string[] args)
{
const string showName = "Californication";
var xml = XDocument.Load("http://www.tvrage.com/feeds/episode_list.php?show=" + showName).Element("Show");
Console.WriteLine(xml);
}
}
}
Any ideas?