예제 #1
0
        public string getRetweets(string profileId, int days)
        {
            TwitterMessageRepository objretwt = new TwitterMessageRepository();
            string strArray = string.Empty;
            string str = string.Empty;
            try
            {
                int cnt = 0;
                ArrayList alstTwt = objretwt.getRetweetStatsByProfileId(profileId, days);

                if (alstTwt != null)
                {
                    //  strArray = "[";
                    for (int i = 0; i < alstTwt.Count; i++)
                    {
                        strArray = strArray + alstTwt[i].ToString() + ",";
                        cnt++;
                    }
                }
                if (cnt < 7)
                {
                    for (int j = 0; j < 7 - cnt; j++)
                    {
                        //strArray = strArray + "0,";
                        str += "0,";
                    }
                }
                //strArray = strArray.Substring(0, strArray.Length - 1);
                strArray = str + strArray;
                strArray = strArray.Substring(0, strArray.Length - 1);
            }
            catch (Exception Err)
            {
                Console.Write(Err.StackTrace);
            }
            return strArray;

        }