Beispiel #1
0
 public void getNewFollowers(int days)
 {
     try
     {
         SocioBoard.Domain.User user = (User)Session["LoggedUser"];
         TwitterStatsRepository objtwtStatsRepo = new TwitterStatsRepository();
         ArrayList arrTwtStats = objtwtStatsRepo.getAllTwitterStatsOfUser(user.Id,days);
         strTwtArray ="[";
         int intdays = 1;
         foreach (var item in arrTwtStats)
         {
             Array temp = (Array)item;
             strTwtArray += (temp.GetValue(4)) + ",";
             spanTwtFollowers.InnerHtml = temp.GetValue(4).ToString();
             hTwtFollowers.InnerHtml = temp.GetValue(4).ToString();
         }
         if (intdays < 7)
         {
             for (int j = 0; j < 7 - intdays; j++)
             {
                 strTwtArray = strTwtArray + "0,";
             }
         }
         strTwtArray = strTwtArray.Substring(0, strTwtArray.Length - 1) +"]";
       //  strTwtArray += "]";
     }
     catch (Exception Err)
     {
         Response.Write(Err.Message.ToString());
     }
 }
Beispiel #2
0
 public void getNewFollowers(int days)
 {
     try
     {
         SocioBoard.Domain.User user = (User)Session["LoggedUser"];
         TwitterStatsRepository objtwtStatsRepo = new TwitterStatsRepository();
         ArrayList arrTwtStats = objtwtStatsRepo.getAllTwitterStatsOfUser(user.Id, days);
         strTwtArray = "[";
         foreach (var item in arrTwtStats)
         {
             Array temp = (Array)item;
             strTwtArray += (temp.GetValue(4)) + ",";
             spanNewTweets.InnerHtml = temp.GetValue(4).ToString();
         }
         if (arrTwtStats.Count > 0)
             strTwtArray = strTwtArray.Substring(0, strTwtArray.Length - 1);
         if (arrTwtStats.Count < 7)
         {
             for (int i = 0; i < 7 - arrTwtStats.Count; i++)
             {
                 strTwtArray = strTwtArray + "0,";
             }
         }
         strTwtArray = strTwtArray.Substring(0, strTwtArray.Length - 1) + "]";
     }
     catch (Exception Err)
     {
         Console.Write(Err.Message.ToString());
         logger.Error(Err.StackTrace);
     }
 }
Beispiel #3
0
        public void getgrphData(int days)
        {
            try
            {
                SocioBoard.Domain.User user = (User)Session["LoggedUser"];
                FacebookAccountRepository objfb = new FacebookAccountRepository();
                TwitterMessageRepository objtwttatsRepo = new TwitterMessageRepository();
                ArrayList alstfb = objfb.getFbMessageStats(user.Id,days);
                ArrayList alstTwt = objtwttatsRepo.gettwtMessageStats(user.Id, days);
                strArray = "[";

                    for (int i = 0; i < 7; i++)
                    {
                        string strTwtCnt = string.Empty;
                        string strFbCnt = string.Empty;
                        if (alstTwt.Count <= i)
                            strTwtCnt = "0";
                        else
                            strTwtCnt = alstTwt[i].ToString();
                        if (alstfb.Count <= i)
                            strFbCnt = "0";
                        else
                            strFbCnt = alstfb[i].ToString();
                        strArray = strArray + "[" + strFbCnt + "," + strTwtCnt + "],";
                        spanIncoming.InnerHtml = (int.Parse(strTwtCnt) + int.Parse(strFbCnt)).ToString();
                    }

                strArray = strArray.Substring(0,strArray.Length-1)+ "]";

                 ArrayList alstTwtFeed = objtwttatsRepo.gettwtFeedsStats(user.Id,days);
                ArrayList alstFBFeed = objfb.getFbFeedsStats(user.Id,days);
                strSentArray = "[";

                if (alstFBFeed.Count > 0 || alstTwtFeed.Count > 0)
                {
                    int alstSentCount = 0;
                    for (int i = 0; i < 7; i++)
                    {
                        string strTwtFeedCnt = string.Empty;
                        string strFbFeedCnt = string.Empty;
                        if (alstTwtFeed.Count <= i)
                            strTwtFeedCnt = "0";
                        else
                            strTwtFeedCnt = alstTwtFeed[i].ToString();
                        if (alstFBFeed.Count <= i)
                            strFbFeedCnt = "0";
                        else
                            strFbFeedCnt = alstFBFeed[i].ToString();
                        strSentArray = strSentArray + "[" + strFbFeedCnt + "," + strTwtFeedCnt + "],";
                        spanSent.InnerHtml = (int.Parse(strFbFeedCnt) + int.Parse(strTwtFeedCnt)).ToString();
                    }

                }
                if (alstFBFeed.Count == 0 || alstTwtFeed.Count == 0)
                {
                    for (int i = 0; i < 7; i++)
                    {
                        strSentArray += strSentArray + "[0,0],";
                    }
                }
                strSentArray = strSentArray.Substring(0, strSentArray.Length - 1) + "]";

                TwitterStatsRepository objtwtStatsRepo = new TwitterStatsRepository();
                ArrayList alstEng = objtwtStatsRepo.getAllTwitterStatsOfUser(user.Id,days);
                int ii = 1;
                strEng = "[";
                foreach (var item in alstEng)
                {
                    Array temp = (Array)item;
                    strEng = strEng + "{ x: new Date(2012, "+ ii +", "+ ii +"), y:" + temp.GetValue(7) + "},";
                    ii++;
                }
                if (alstEng.Count == 0)
                {
                    for (int i = 0; i < 10; i++)
                    {
                        strEng = strEng + "{ x: new Date(2012, " + ii + ", " + ii + "), y:0},";
                    }
                }
                strEng = strEng.Substring(0, strEng.Length - 1) + "]";

                hmsgsent.InnerHtml = alstTwtFeed.Count.ToString();
                hretweet.InnerHtml = objtwttatsRepo.getUserRetweetCount(user.Id).ToString();

            }
            catch (Exception Err)
            {
                Response.Write(Err.StackTrace);
            }
        }
Beispiel #4
0
 public void getNewFollowers(int days)
 {
     try
     {
         SocioBoard.Domain.User user = (User)Session["LoggedUser"];
         TwitterStatsRepository objtwtStatsRepo = new TwitterStatsRepository();
         ArrayList arrTwtStats = objtwtStatsRepo.getAllTwitterStatsOfUser(user.Id, days);
         strTwtArray = "[";
         foreach (TwitterStats item in arrTwtStats)
         {
             strTwtArray += (item.FollowerCount) + ",";
         }
         if (arrTwtStats.Count > 0)
             strTwtArray = strTwtArray.Substring(0, strTwtArray.Length - 1);
         if (arrTwtStats.Count < 7)
         {
             for (int i = 0; i < 7 - arrTwtStats.Count; i++)
             {
                 strTwtArray = strTwtArray + "0,";
             }
         }
         strTwtArray += "]";
     }
     catch (Exception Err)
     {
         Console.Write(Err.Message.ToString());
     }
 }