Example #1
0
        private static void groupreports()
        {
            Api.GroupReports.GroupReports groups = new Api.GroupReports.GroupReports();
            Api.FacebookGroupReport.FacebookGroupReport ApiFacebookGroupReport = new Api.FacebookGroupReport.FacebookGroupReport();
            List <Domain.Socioboard.Domain.Groups>      grouplst = (List <Domain.Socioboard.Domain.Groups>) new JavaScriptSerializer().Deserialize(groups.getgroups(), typeof(List <Domain.Socioboard.Domain.Groups>));

            foreach (Domain.Socioboard.Domain.Groups grpid in grouplst)
            {
                try
                {
                    Console.WriteLine("Hereeee");
                    Domain.Socioboard.Domain.GroupReports insert = new Domain.Socioboard.Domain.GroupReports();
                    insert.Id      = Guid.NewGuid();
                    insert.GroupId = grpid.Id;

                    groups.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(groups.getinboxcount(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("1");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r2 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(groups.gettwitterfollowers(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("3");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r3 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(groups.getfbfans(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r4 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(groups.getinteractions(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("5");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r1 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(groups.getsentmessage(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("2");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r5 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(groups.gettwtmentions(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("6");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r6 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(groups.gettwtretweets(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("7");

                    string sexratio = groups.gettwittersexdivision(grpid.Id.ToString(), grpid.UserId.ToString());
                    Console.WriteLine("8");

                    string twitter_account = groups.total_twitter_accounts(grpid.Id.ToString(), grpid.UserId.ToString());


                    insert.inbox_15        = r._15;
                    insert.inbox_30        = r._30;
                    insert.inbox_60        = r._60;
                    insert.inbox_90        = r._90;
                    insert.perday_inbox_15 = r.perday_15;
                    insert.perday_inbox_30 = r.perday_30;
                    insert.perday_inbox_60 = r.perday_60;
                    insert.perday_inbox_90 = r.perday_90;

                    Console.WriteLine("After 2");

                    insert.sent_15        = r1._15;
                    insert.sent_30        = r1._30;
                    insert.sent_60        = r1._60;
                    insert.sent_90        = r1._90;
                    insert.perday_sent_15 = r1.perday_15;
                    insert.perday_sent_30 = r1.perday_30;
                    insert.perday_sent_60 = r1.perday_60;
                    insert.perday_sent_90 = r1.perday_90;

                    insert.twitterfollower_15        = r2._15;
                    insert.twitterfollower_30        = r2._30;
                    insert.twitterfollower_60        = r2._60;
                    insert.twitterfollower_90        = r2._90;
                    insert.perday_twitterfollower_15 = r2.perday_15;
                    insert.perday_twitterfollower_30 = r2.perday_30;
                    insert.perday_twitterfollower_60 = r2.perday_60;
                    insert.perday_twitterfollower_90 = r2.perday_90;


                    insert.fbfan_15        = r3._15;
                    insert.fbfan_30        = r3._30;
                    insert.fbfan_60        = r3._60;
                    insert.fbfan_90        = r3._90;
                    insert.perday_fbfan_15 = r3.perday_15;
                    insert.perday_fbfan_30 = r3.perday_30;
                    insert.perday_fbfan_60 = r3.perday_60;
                    insert.perday_fbfan_90 = r3.perday_90;


                    insert.interaction_15        = r4._15;
                    insert.interaction_30        = r4._30;
                    insert.interaction_60        = r4._60;
                    insert.interaction_90        = r4._90;
                    insert.perday_interaction_15 = r4.perday_15;
                    insert.perday_interaction_30 = r4.perday_30;
                    insert.perday_interaction_60 = r4.perday_60;
                    insert.perday_interaction_90 = r4.perday_90;

                    insert.twtmentions_15        = r5._15;
                    insert.perday_twtmentions_15 = r5.perday_15;

                    insert.twtmentions_30        = r5._30;
                    insert.perday_twtmentions_30 = r5.perday_30;

                    insert.twtmentions_60        = r5._60;
                    insert.perday_twtmentions_60 = r5.perday_60;

                    insert.twtmentions_90        = r5._90;
                    insert.perday_twtmentions_90 = r5.perday_90;

                    insert.twtretweets_15        = r6._15;
                    insert.perday_twtretweets_15 = r6.perday_15;

                    insert.twtretweets_30        = r6._30;
                    insert.perday_twtretweets_30 = r6.perday_30;

                    insert.twtretweets_60        = r6._60;
                    insert.perday_twtretweets_60 = r6.perday_60;

                    insert.twtretweets_90        = r6._90;
                    insert.perday_twtretweets_90 = r6.perday_90;
                    insert.sexratio = sexratio;
                    insert.twitter_account_count = long.Parse(twitter_account);

                    string senddata = new JavaScriptSerializer().Serialize(insert);
                    //    Console.WriteLine("Insert");
                    groups.insertdata(senddata);
                    //      Console.WriteLine("Insert Completed");
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                try
                {
                    ApiFacebookGroupReport.Timeout = -1;
                    ApiFacebookGroupReport.FacebookGroupData(grpid.Id.ToString(), grpid.UserId.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Example #2
0
        private static void groupreports()
        {
            Api.GroupReports.GroupReports groups = new Api.GroupReports.GroupReports();
            Api.FacebookGroupReport.FacebookGroupReport ApiFacebookGroupReport = new Api.FacebookGroupReport.FacebookGroupReport();
            List<Domain.Socioboard.Domain.Groups> grouplst = (List<Domain.Socioboard.Domain.Groups>)new JavaScriptSerializer().Deserialize(groups.getgroups(), typeof(List<Domain.Socioboard.Domain.Groups>));
            foreach (Domain.Socioboard.Domain.Groups grpid in grouplst)
            {
                try
                {
                    Console.WriteLine("Hereeee");
                    Domain.Socioboard.Domain.GroupReports insert = new Domain.Socioboard.Domain.GroupReports();
                    insert.Id = Guid.NewGuid();
                    insert.GroupId = grpid.Id;

                    groups.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(groups.getinboxcount(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("1");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r2 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(groups.gettwitterfollowers(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("3");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r3 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(groups.getfbfans(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r4 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(groups.getinteractions(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("5");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r1 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(groups.getsentmessage(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("2");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r5 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(groups.gettwtmentions(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("6");
                    groups.Timeout = -1;

                    Domain.Socioboard.Domain.ReturnData r6 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(groups.gettwtretweets(grpid.Id.ToString(), grpid.UserId.ToString()), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("7");

                    string sexratio = groups.gettwittersexdivision(grpid.Id.ToString(), grpid.UserId.ToString());
                    Console.WriteLine("8");

                    string twitter_account = groups.total_twitter_accounts(grpid.Id.ToString(), grpid.UserId.ToString());


                    insert.inbox_15 = r._15;
                    insert.inbox_30 = r._30;
                    insert.inbox_60 = r._60;
                    insert.inbox_90 = r._90;
                    insert.perday_inbox_15 = r.perday_15;
                    insert.perday_inbox_30 = r.perday_30;
                    insert.perday_inbox_60 = r.perday_60;
                    insert.perday_inbox_90 = r.perday_90;

                    Console.WriteLine("After 2");

                    insert.sent_15 = r1._15;
                    insert.sent_30 = r1._30;
                    insert.sent_60 = r1._60;
                    insert.sent_90 = r1._90;
                    insert.perday_sent_15 = r1.perday_15;
                    insert.perday_sent_30 = r1.perday_30;
                    insert.perday_sent_60 = r1.perday_60;
                    insert.perday_sent_90 = r1.perday_90;

                    insert.twitterfollower_15 = r2._15;
                    insert.twitterfollower_30 = r2._30;
                    insert.twitterfollower_60 = r2._60;
                    insert.twitterfollower_90 = r2._90;
                    insert.perday_twitterfollower_15 = r2.perday_15;
                    insert.perday_twitterfollower_30 = r2.perday_30;
                    insert.perday_twitterfollower_60 = r2.perday_60;
                    insert.perday_twitterfollower_90 = r2.perday_90;


                    insert.fbfan_15 = r3._15;
                    insert.fbfan_30 = r3._30;
                    insert.fbfan_60 = r3._60;
                    insert.fbfan_90 = r3._90;
                    insert.perday_fbfan_15 = r3.perday_15;
                    insert.perday_fbfan_30 = r3.perday_30;
                    insert.perday_fbfan_60 = r3.perday_60;
                    insert.perday_fbfan_90 = r3.perday_90;


                    insert.interaction_15 = r4._15;
                    insert.interaction_30 = r4._30;
                    insert.interaction_60 = r4._60;
                    insert.interaction_90 = r4._90;
                    insert.perday_interaction_15 = r4.perday_15;
                    insert.perday_interaction_30 = r4.perday_30;
                    insert.perday_interaction_60 = r4.perday_60;
                    insert.perday_interaction_90 = r4.perday_90;

                    insert.twtmentions_15 = r5._15;
                    insert.perday_twtmentions_15 = r5.perday_15;

                    insert.twtmentions_30 = r5._30;
                    insert.perday_twtmentions_30 = r5.perday_30;

                    insert.twtmentions_60 = r5._60;
                    insert.perday_twtmentions_60 = r5.perday_60;

                    insert.twtmentions_90 = r5._90;
                    insert.perday_twtmentions_90 = r5.perday_90;

                    insert.twtretweets_15 = r6._15;
                    insert.perday_twtretweets_15 = r6.perday_15;

                    insert.twtretweets_30 = r6._30;
                    insert.perday_twtretweets_30 = r6.perday_30;

                    insert.twtretweets_60 = r6._60;
                    insert.perday_twtretweets_60 = r6.perday_60;

                    insert.twtretweets_90 = r6._90;
                    insert.perday_twtretweets_90 = r6.perday_90;
                    insert.sexratio = sexratio;
                    insert.twitter_account_count = long.Parse(twitter_account);

                    string senddata = new JavaScriptSerializer().Serialize(insert);
                    //    Console.WriteLine("Insert");
                    groups.insertdata(senddata);
                    //      Console.WriteLine("Insert Completed");

                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                try
                {
                    ApiFacebookGroupReport.Timeout = -1;
                    ApiFacebookGroupReport.FacebookGroupData(grpid.Id.ToString(), grpid.UserId.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }


        }