Пример #1
0
        /// <summary>
        /// YP情報を解析する
        /// </summary>
        private List<ChannelHistory> analyzeYPText(YP yp, string html)
        {
            string[] indexText = html.Split(new String[] { "\n" }, StringSplitOptions.None);
            List<ChannelHistory> channelList = new List<ChannelHistory>();

            foreach (string line in indexText)
            {
                string[] element = line.Split(new String[] { "<>" }, StringSplitOptions.None);
                if (element.Length != 19)
                {
                    continue;
                }
                ChannelHistory channel = new ChannelHistory(yp, element);
                channelList.Add(channel);
            }

            return channelList;
        }
Пример #2
0
        public void update(ChannelHistory history)
        {
            string time_to = DateTime.Now.ToString("HHmmss");

            string sql = string.Format(@"
            UPDATE
            channel_history
            SET
            time_to = '{0}',
            time = '{1}',
            listener = '{2}',
            relay = '{3}'
            WHERE
            date = '{4}'
            AND time_from = '{5}'
            AND channel_id = '{6}'
            ", time_to, time,
             ((int.Parse(history.listener) < int.Parse(listener)) ? listener : history.listener),
             ((int.Parse(history.relay) < int.Parse(relay)) ? relay : history.relay),
             history.date, history.time_from, history.channel_id);
            SqlRequest.requestSql(sql);
        }
Пример #3
0
 public bool equal(ChannelHistory channel)
 {
     return
         // (date == channel.date) &&
         // (time_from == channel.time_from) &&
         // (time_to == channel.time_to) &&
         // (channel_id == channel.channel_id) &&
         // (yp_id == channel.yp_id) &&
         // (channel_name == channel.channel_name) &&
         // (stream_id == channel.stream_id) &&
         // (tip == channel.tip) &&
         (contact_url == channel.contact_url) &&
         (genre == channel.genre) &&
         (detail == channel.detail) &&
         // (listener == channel.listener) &&
         // (relay == channel.relay) &&
         // (bitrate == channel.bitrate) &&
         // (stream_type == channel.stream_type) &&
         (artist == channel.artist) &&
         (album == channel.album) &&
         (title == channel.title) &&
         (url == channel.url) &&
         // (encoded_name == channel.encoded_name) &&
         // (time == channel.time) &&
         // (alt == channel.alt) &&
         (comment == channel.comment);
         // (direct == channel.direct);
         // (update_time == channel.update_time);
 }