Esempio n. 1
0
        private ArrayList ParseNeighbours(string content)
        {
            XmlDocument xml = new XmlDocument ();
            XmlNodeList elemlist;
            ArrayList neighbours = new ArrayList ();

            xml.LoadXml (content);
            elemlist = xml.GetElementsByTagName ("neighbours");
            if (elemlist.Count == 0) {
                return neighbours;
            }

            elemlist = xml.GetElementsByTagName ("user");
            IEnumerator ienum = elemlist.GetEnumerator ();
            while (ienum.MoveNext ()) {
                XmlNode n_node = (XmlNode) ienum.Current;
                string name = n_node.Attributes.GetNamedItem ("username").InnerText;
                string url = get_node_text (n_node, "url");
                string image = get_node_text (n_node, "image");

                Fan f = new Fan (name, url, image, 0);
                neighbours.Add (f);
            }

            return neighbours;
        }
Esempio n. 2
0
        private ArrayList ParseFans(string content)
        {
            XmlDocument xml = new XmlDocument ();
            XmlNodeList elemlist;
            ArrayList fans = new ArrayList ();

            xml.LoadXml (content);
            elemlist = xml.GetElementsByTagName ("fans");
            if (elemlist.Count == 0) {
                return fans;
            }

            elemlist = xml.GetElementsByTagName ("user");
            IEnumerator ienum = elemlist.GetEnumerator ();
            while (ienum.MoveNext ()) {
                XmlNode f_node = (XmlNode) ienum.Current;
                string name = f_node.Attributes.GetNamedItem ("username").InnerText;
                string url = get_node_text (f_node, "url");
                string image = get_node_text (f_node, "image");
                int weight = Int32.Parse (get_node_text (f_node, "weight"));

                Fan f = new Fan (name, url, image, weight);
                fans.Add (f);
            }

            return fans;
        }