Exemplo n.º 1
0
 private static void SaveQueue(UrlQueue url)
 {
     ThriftTool.AddColumn(url.Url, "UrlQueue", "Url", url.Url);
     ThriftTool.AddColumn(url.Url, "UrlQueue", "Title", url.Title);
     ThriftTool.AddColumn(url.Url, "UrlQueue", "Type", url.Type);
     ThriftTool.AddColumn(url.Url, "UrlQueue", "Status", url.Status);
 }
Exemplo n.º 2
0
        public static string ProcessQueue()
        {
            //var result = string.Empty;

            int tempi = 0;

            CqlResult cqlResult = ThriftTool.GetByCql("Select * from UrlQueue where 'Status'='" + QueueType.Queue.ToString() + "' and 'Type'='M01' limit 5");

            //result = cqlResult.Rows.Count.ToString();
            //CqlResult cqlResult = ThriftTool.GetByCql("select top 1 * from UrlQueue where Status=" + (int)QueueType.Queue , client);
            //CqlResult cqlResult = client.execute_cql_query(ThriftTool.ToByte("select * from BahamutGames where Title='" + gameList[i] + "'"), Compression.NONE);
            foreach (var row in cqlResult.Rows)
            {
                var url = new UrlQueue();
                foreach (var col in row.Columns)
                {
                    var name = ThriftTool.ToString(col.Name);

                    switch (name)
                    {
                    case "Title":
                        url.Title = ThriftTool.ToString(col.Value);
                        break;

                    case "Url":
                        url.Url = ThriftTool.ToString(col.Value);
                        break;

                    case "Status":
                        url.Status = ThriftTool.ToString(col.Value);
                        break;

                    case "Type":
                        url.Type = ThriftTool.ToString(col.Value);
                        break;
                    }
                    //result = url.Url;
                    //process topic
                    //result += url.Url;
                }

                if (url.Url != null)
                {
                    //result = "http://www.mobile01.com/" + url.Url;
                    ProcessUrl("http://www.mobile01.com/" + url.Url);
                    tempi++;
                }

                //mark as done
                ThriftTool.AddColumn(url.Url, "UrlQueue", "Status", QueueType.Done.ToString());
            }
            return(tempi.ToString());
        }
Exemplo n.º 3
0
 private static void SaveTopic(M01Topic topic)
 {
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Forum", topic.Forum);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Pdate", topic.Pdate);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Pid", topic.Pid);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Uid", topic.Uid);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Content", topic.Content);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Plevel", topic.Plevel);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Aid", topic.Aid);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Aowner", topic.Aowner);
     ThriftTool.AddColumn(topic.Pid, "M01Topic", "Title", topic.Title);
 }