Exemplo n.º 1
0
        public DataTable GetTopic(string address)
        {
            QQWeiBo bo = new QQWeiBo();

            if (HttpRuntime.Cache["AstroDiceTopic"] == null)
            {
                DataTable table = new DataTable();
                table.Columns.Add("QuestID");
                table.Columns.Add("QuestContent");
                table.Columns.Add("QuestUserID");
                table.Columns.Add("QuestUserName");
                table.Columns.Add("QuestPhoto");
                table.Columns.Add("QuestTime");
                if (address == null || address == "")
                {
                    address = base.Request.UserHostAddress;
                }
                XmlDocument document = bo.GetTopicList(this.openid, this.openkey, address, "占星骰子", 0, AppEnum.Apps.astrodice);
                XmlNode     node     = document.SelectSingleNode("//root");
                if ((node != null) && (node.SelectSingleNode("//ret").InnerXml == "0"))
                {
                    XmlNodeList list = document.SelectNodes("//data/info");
                    if (list.Count > 0)
                    {
                        foreach (XmlNode node2 in list)
                        {
                            XmlNode node3 = node2.SelectSingleNode("origtext");
                            if (node3.InnerXml.Contains("# #"))
                            {
                                DataRow row = table.NewRow();
                                row["QuestID"]       = node2.SelectSingleNode("id").InnerXml;
                                row["QuestContent"]  = this.GetFace(node2.SelectSingleNode("origtext").InnerXml);
                                row["QuestUserID"]   = node2.SelectSingleNode("name").InnerXml;
                                row["QuestUserName"] = node2.SelectSingleNode("nick").InnerXml;
                                row["QuestPhoto"]    = node2.SelectSingleNode("head").InnerXml;
                                row["QuestTime"]     = node2.SelectSingleNode("timestamp").InnerXml;
                                if (row["QuestPhoto"].ToString() != "")
                                {
                                    table.Rows.Add(row);
                                }
                            }
                        }
                    }
                }

                int index = 0x19;
                while (table.Rows.Count > 0x19)
                {
                    table.Rows.RemoveAt(index);
                }
                HttpRuntime.Cache.Insert("AstroDiceTopic", table, null, DateTime.Now.AddMinutes(5.0), TimeSpan.Zero, CacheItemPriority.High, null);
                if (table != null && table.Rows.Count > 0)
                {
                    Quests = table.Copy();
                }
            }
            return(Quests);
        }
Exemplo n.º 2
0
        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            QQWeiBo bo = new QQWeiBo();

            try
            {
                if (bo.SendPicWeiBo(this.openid, this.openkey, base.Request.UserHostAddress, "#金星星座#我刚用了超灵的“金星爱情分析器”。原来我的" + this.titles[((int)this.ViewState["ele"]) - 1] + this.contexts[((int)this.ViewState["ele"]) - 1].Substring(0, 50).Replace("你", "我") + "... 一起来试试吧,点击 http://app.t.qq.com/app/play/801269870 更多占星术知识请收听 @iamsnowsnow", "http://t2.qpic.cn/mblogpic/310462b251813df5ecac/2000", AppEnum.Apps.venus))
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "share", "alert('分享成功!');", true);
                }
            }
            catch
            {
            }
        }
Exemplo n.º 3
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            QQWeiBo bo = new QQWeiBo();

            try
            {
                if ((this.oauth2token == "") ? bo.AddFriend(this.openid, this.openkey, base.Request.UserHostAddress, "iamsnowsnow", AppEnum.Apps.astrodice) : bo.AddFriend(this.openid, this.oauth2token, base.Request.UserHostAddress, "iamsnowsnow", AppEnum.Apps.astrodice, true))
                {
                    ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "listen", "alert('收听成功!');", true);
                    this.nofriend1.Style["display"] = "none";
                    this.isfriend1.Style["display"] = "";
                }
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 4
0
        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            QQWeiBo bo = new QQWeiBo();

            try
            {
                if (bo.SendPicWeiBo(this.openid, this.openkey, base.Request.UserHostAddress, this.TextBox1.Text + " 更多占星术知识请收听 @iamsnowsnow", "http://t2.qpic.cn/mblogpic/b45699c516c2a873185c/460", AppEnum.Apps.astrodice))
                {
                    ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "share", "alert('发布成功!请留意该条微博的转播与评论,占卜师可能会为你解答哦!');", true);
                }
                if (!this.TextBox1.Text.Contains("请输入您要占卜的问题") && !(this.TextBox1.Text.Trim() == ""))
                {
                }
            }
            catch
            {
            }
        }
Exemplo n.º 5
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            QQWeiBo bo = new QQWeiBo();

            try
            {
                if (bo.AddFriend(this.openid, this.openkey, base.Request.UserHostAddress, "iamsnowsnow", AppEnum.Apps.venus))
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "listen", "alert('收听成功!');", true);
                    this.nofriend1.Style["display"] = "none";
                    this.nofriend2.Style["display"] = "none";
                    this.isfriend1.Style["display"] = "";
                    this.isfriend2.Style["display"] = "";
                }
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((base.Request.QueryString["openid"] != null) && (base.Request.QueryString["openid"] != ""))
     {
         this.openid = base.Request.QueryString["openid"];
     }
     if ((base.Request.QueryString["openkey"] != null) && (base.Request.QueryString["openkey"] != ""))
     {
         this.openkey = base.Request.QueryString["openkey"];
     }
     if ((base.Request.QueryString["name"] != null) && (base.Request.QueryString["name"] != ""))
     {
         this.wb_name = base.Request.QueryString["name"];
     }
     if ((base.Request.QueryString["oauth2atoken"] != null) && (base.Request.QueryString["oauth2atoken"] != ""))
     {
         try
         {
             string[] strArray = base.Request.QueryString["oauth2atoken"].Split(new char[] { '&' });
             this.oauth2token = strArray[0].Split(new char[] { '=' })[0];
             this.expire      = DateTime.Now.AddSeconds((double)int.Parse(strArray[1].Split(new char[] { '=' })[1]));
         }
         catch
         {
         }
     }
     if ((base.Request.QueryString["nick"] != null) && (base.Request.QueryString["nick"] != ""))
     {
         this.wb_nick = base.Request.QueryString["nick"];
     }
     if (!base.IsPostBack)
     {
         Dictionary <string, string> dictionary = new Dictionary <string, string>();
         for (int i = 0; i <= 0x17; i++)
         {
             dictionary.Add(i.ToString(), i.ToString());
         }
         this.ddlHour.DataSource     = dictionary;
         this.ddlHour.DataTextField  = "Key";
         this.ddlHour.DataValueField = "Value";
         this.ddlHour.DataBind();
         this.ddlHour.SelectedIndex = 12;
         QQWeiBo bo = new QQWeiBo();
         if (this.openid != "")
         {
             QQWeiBoUserMod recordByName = QQWeiBoUserBll.GetInstance().GetRecordByName(this.wb_name);
             if (recordByName.SysNo <= 0)
             {
                 string[] strArray2 = bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.venus).Split(new char[] { '|' });
                 recordByName.Oauth2Token = this.oauth2token;
                 recordByName.OpenId      = this.openid;
                 recordByName.TS          = DateTime.Now;
                 recordByName.WB_Name     = this.wb_name;
                 recordByName.WB_Nick     = this.wb_nick;
                 recordByName.Location    = strArray2[2];
                 recordByName.FansNum     = int.Parse(strArray2[3]);
                 recordByName.IsVIP       = int.Parse(strArray2[4]);
                 QQWeiBoUserBll.GetInstance().Add(recordByName);
             }
             else if ((recordByName.WB_Name == "") || (recordByName.FansNum == -999999))
             {
                 string[] strArray3 = bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.venus).Split(new char[] { '|' });
                 recordByName.WB_Name  = this.wb_name;
                 recordByName.WB_Nick  = this.wb_nick;
                 recordByName.Location = strArray3[2];
                 recordByName.FansNum  = int.Parse(strArray3[3]);
                 recordByName.IsVIP    = int.Parse(strArray3[4]);
                 QQWeiBoUserBll.GetInstance().Update(recordByName);
             }
         }
         if (bo.CheckFriend(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.venus))
         {
             this.nofriend1.Style["display"] = "none";
             this.nofriend2.Style["display"] = "none";
         }
         else
         {
             this.isfriend1.Style["display"] = "none";
             this.isfriend2.Style["display"] = "none";
         }
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((base.Request.QueryString["openid"] != null) && (base.Request.QueryString["openid"] != ""))
     {
         this.openid = base.Request.QueryString["openid"];
     }
     if ((base.Request.QueryString["openkey"] != null) && (base.Request.QueryString["openkey"] != ""))
     {
         this.openkey = base.Request.QueryString["openkey"];
     }
     if ((base.Request.QueryString["name"] != null) && (base.Request.QueryString["name"] != ""))
     {
         this.wb_name = base.Request.QueryString["name"];
     }
     if ((base.Request.QueryString["oauth2atoken"] != null) && (base.Request.QueryString["oauth2atoken"] != ""))
     {
         try
         {
             string[] strArray = base.Request.QueryString["oauth2atoken"].Split(new char[] { '&' });
             this.oauth2token = strArray[0].Split(new char[] { '=' })[0];
             this.expire      = DateTime.Now.AddSeconds((double)int.Parse(strArray[1].Split(new char[] { '=' })[1]));
         }
         catch
         {
         }
     }
     if ((base.Request.QueryString["nick"] != null) && (base.Request.QueryString["nick"] != ""))
     {
         this.wb_nick = base.Request.QueryString["nick"];
     }
     if (!base.IsPostBack)
     {
         this.MultiView1.ActiveViewIndex = 0;
         QQWeiBo        bo           = new QQWeiBo();
         QQWeiBoUserMod recordByName = QQWeiBoUserBll.GetInstance().GetRecordByName(this.wb_name);
         if (this.openid != "")
         {
             if (recordByName.SysNo <= 0)
             {
                 string[] strArray2 = (this.oauth2token == "") ? bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice).Split(new char[] { '|' }) : bo.GetUserSimpleInfo(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true).Split(new char[] { '|' });
                 recordByName.Oauth2Token1 = this.oauth2token;
                 recordByName.OpenId1      = this.openid;
                 recordByName.Expire1      = this.expire;
                 recordByName.WB_Name      = this.wb_name;
                 recordByName.WB_Nick      = this.wb_nick;
                 recordByName.TS           = DateTime.Now;
                 recordByName.Location     = strArray2[2];
                 recordByName.FansNum      = int.Parse(strArray2[3]);
                 recordByName.IsVIP        = int.Parse(strArray2[4]);
                 QQWeiBoUserBll.GetInstance().Add(recordByName);
                 this.ViewState["userpara"] = strArray2;
             }
             else if ((recordByName.WB_Name == "") || (recordByName.FansNum == -999999))
             {
                 string[] strArray3 = (this.oauth2token == "") ? bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice).Split(new char[] { '|' }) : bo.GetUserSimpleInfo(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true).Split(new char[] { '|' });
                 recordByName.Oauth2Token1 = this.oauth2token;
                 recordByName.OpenId1      = this.openid;
                 recordByName.Expire1      = this.expire;
                 recordByName.WB_Name      = this.wb_name;
                 recordByName.WB_Nick      = this.wb_nick;
                 recordByName.Location     = strArray3[2];
                 recordByName.FansNum      = int.Parse(strArray3[3]);
                 recordByName.IsVIP        = int.Parse(strArray3[4]);
                 QQWeiBoUserBll.GetInstance().Update(recordByName);
                 this.ViewState["userpara"] = strArray3;
             }
             else
             {
                 string[] strArray4 = (this.oauth2token == "") ? bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice).Split(new char[] { '|' }) : bo.GetUserSimpleInfo(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true).Split(new char[] { '|' });
                 this.ViewState["userpara"] = strArray4;
             }
         }
         this.ViewState["weibouser"] = recordByName;
         if ((this.oauth2token == "") ? bo.CheckFriend(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice) : bo.CheckFriend(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true))
         {
             this.nofriend1.Style["display"] = "none";
         }
         else
         {
             this.isfriend1.Style["display"] = "none";
         }
         this.LinkButton8.Style["display"]  = "none";
         this.LinkButton9.Style["display"]  = "none";
         this.LinkButton10.Style["display"] = "none";
         this.Label1.Text = "<p><b>提问说明:</b><br />★一定要是你很诚心很想知道的事。问题可以是具体的小事,如今天晚上吃什么;也可以是别人的是,某某明星是不是真的有外遇。<br />\r\n                                  ★不要在短时间内重复问一个问题,除非事态已经有了新的变化。<br />\r\n                                  ★问Whether不如问How,骰子不会简单回答Yes或No。如果问“我该跳槽么?”不如问“如果换工作的话前景如何?”</p>\r\n                                 <p><b>特别提示:</b><br />★占星骰子需消耗灵力,建议一天内不要超过3次,否则会降低准确度。<br />\r\n                                  ★骰子给出的结果需要你对行星,星座和宫位的关键字含义进行意会。<br />\r\n                                  ★如无法理解骰子的结果,可以把问题发出,等待专业占星师解答。</p><p style='color:#fffd64;'>若需购买占星骰子实物,请在淘宝搜索“超级占星骰子”</p>";
         try
         {
             GetTopic("");
             this.Repeater1.DataSource = this.GetReplys("");
             this.Repeater1.DataBind();
         }
         catch
         {
         }
     }
 }
Exemplo n.º 8
0
        public DataTable GetReplys(string address)
        {
            QQWeiBo bo = new QQWeiBo();

            if (HttpRuntime.Cache["AstroDiceLastReply"] == null)
            {
                DataTable table = new DataTable();
                table.Columns.Add("QuestID");
                table.Columns.Add("ReplyID");
                table.Columns.Add("QuestContent");
                table.Columns.Add("ReplyContent");
                table.Columns.Add("QuestUserID");
                table.Columns.Add("ReplyUserID");
                table.Columns.Add("QuestUserName");
                table.Columns.Add("ReplyUserName");
                table.Columns.Add("QuestPhoto");
                table.Columns.Add("ReplyPhoto");
                table.Columns.Add("QuestTime");
                table.Columns.Add("ReplyTime");
                string[] strArray = new string[] { "sd59922490", "iamsnowsnow", "jimbeam123", "*****@*****.**", "god82953378", "bubuzhanxing", "yiraneasy", "susan1114" };
                foreach (string str in strArray)
                {
                    if (address == null || address == "")
                    {
                        address = base.Request.UserHostAddress;
                    }
                    XmlDocument document = bo.GetUserWeiBoList(this.openid, this.openkey, address, str, 3, AppEnum.Apps.astrodice);
                    XmlNode     node     = document.SelectSingleNode("//root");
                    if ((node != null) && (node.SelectSingleNode("//ret").InnerXml == "0"))
                    {
                        XmlNodeList list = document.SelectNodes("//data/info");
                        if (list.Count > 0)
                        {
                            foreach (XmlNode node2 in list)
                            {
                                XmlNode node3 = node2.SelectSingleNode("source/from");
                                if ((node3 != null) && (node3.InnerXml == "超级占星骰子" || node2.SelectSingleNode("source/origtext").InnerXml.Contains("#占星骰子# #")))
                                {
                                    DataRow row = table.NewRow();
                                    row["QuestID"]       = node2.SelectSingleNode("source/id").InnerXml;
                                    row["ReplyID"]       = node2.SelectSingleNode("id").InnerXml;
                                    row["QuestContent"]  = this.GetFace(node2.SelectSingleNode("source/origtext").InnerXml);
                                    row["ReplyContent"]  = this.GetFace(node2.SelectSingleNode("origtext").InnerXml);
                                    row["QuestUserID"]   = node2.SelectSingleNode("source/name").InnerXml;
                                    row["ReplyUserID"]   = node2.SelectSingleNode("name").InnerXml;
                                    row["QuestUserName"] = node2.SelectSingleNode("source/nick").InnerXml;
                                    row["ReplyUserName"] = node2.SelectSingleNode("nick").InnerXml;
                                    row["QuestPhoto"]    = node2.SelectSingleNode("source/head").InnerXml;
                                    row["ReplyPhoto"]    = node2.SelectSingleNode("head").InnerXml;
                                    row["QuestTime"]     = node2.SelectSingleNode("source/timestamp").InnerXml;
                                    row["ReplyTime"]     = node2.SelectSingleNode("timestamp").InnerXml;
                                    if (!row["ReplyContent"].ToString().Contains("||") && !row["ReplyContent"].ToString().Contains("@"))
                                    {
                                        int pos = -1;
                                        for (int i = 0; i < table.Rows.Count; i++)
                                        {
                                            if (long.Parse(table.Rows[i]["ReplyTime"].ToString()) < long.Parse(row["ReplyTime"].ToString()))
                                            {
                                                pos = i;
                                                break;
                                            }
                                        }
                                        if (pos == -1)
                                        {
                                            table.Rows.Add(row);
                                        }
                                        else
                                        {
                                            table.Rows.InsertAt(row, pos);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                int index = 0x19;
                while (table.Rows.Count > 0x19)
                {
                    table.Rows.RemoveAt(index);
                }
                HttpRuntime.Cache.Insert("AstroDiceLastReply", table, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero, CacheItemPriority.High, null);
                if (table != null && table.Rows.Count > 0)
                {
                    Replys = table.Copy();
                }
            }
            return(Replys);
        }