Пример #1
0
        private static void instagramreport()
        {
            Api.InstagramReports.InstagramReports ApiInstaReportObj = new Api.InstagramReports.InstagramReports();
            Api.Instagram.Instagram ApiInstaObj = new Api.Instagram.Instagram();

            Domain.Socioboard.Domain.InstagramReport         insert   = new Domain.Socioboard.Domain.InstagramReport();
            List <Domain.Socioboard.Domain.InstagramAccount> accounts = (List <Domain.Socioboard.Domain.InstagramAccount>) new JavaScriptSerializer().Deserialize(ApiInstaObj.getInstaAccounts(), typeof(List <Domain.Socioboard.Domain.InstagramAccount>));

            foreach (Domain.Socioboard.Domain.InstagramAccount account in accounts)
            {
                try
                {
                    Guid   Id         = Guid.NewGuid();
                    string Profile_Id = account.InstagramId;
                    Domain.Socioboard.Domain.InstagramUserDetails user_details = (Domain.Socioboard.Domain.InstagramUserDetails) new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramUserDetail(account.InstagramId), typeof(Domain.Socioboard.Domain.InstagramUserDetails));
                    string Insta_Name  = user_details.Insta_Name;
                    string Full_Name   = user_details.Full_Name;
                    string Media_count = user_details.Media_Count;
                    string Follower    = user_details.Follower;
                    string Following   = user_details.Following;
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(ApiInstaReportObj.GetVideoPosts(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("1");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r1 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(ApiInstaReportObj.GetImagePosts(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("2");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r2 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramFollowerGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("3");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r3 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramFollowingGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r4 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramPostCommentGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r5 = (Domain.Socioboard.Domain.ReturnData) new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramPostLikesGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");

                    insert.Id          = Id;
                    insert.Profile_Id  = Profile_Id;
                    insert.Insta_Name  = Insta_Name;
                    insert.Full_Name   = Full_Name;
                    insert.Media_Count = Media_count;
                    insert.Follower    = Follower;
                    insert.Following   = Following;

                    insert.follow_15        = r2._15;
                    insert.perday_follow_15 = r2.perday_15;
                    insert.follow_30        = r1._30;
                    insert.perday_follow_30 = r2.perday_30;
                    insert.follow_60        = r2._60;
                    insert.perday_follow_60 = r2.perday_60;
                    insert.follow_90        = r2._90;
                    insert.perday_follow_90 = r2.perday_90;

                    insert.following_15        = r3._15;
                    insert.perday_following_15 = r3.perday_15;
                    insert.following_30        = r3._30;
                    insert.perday_following_30 = r3.perday_30;
                    insert.following_60        = r3._60;
                    insert.perday_following_60 = r3.perday_60;
                    insert.following_90        = r3._90;
                    insert.perday_following_90 = r3.perday_90;

                    insert.postcomment_15        = r4._15;
                    insert.perday_postcomment_15 = r4.perday_15;
                    insert.postcomment_30        = r4._30;
                    insert.perday_postcomment_30 = r4.perday_30;
                    insert.postcomment_60        = r4._60;
                    insert.perday_postcomment_60 = r4.perday_60;
                    insert.postcomment_90        = r4._90;
                    insert.perday_postcomment_90 = r4.perday_90;

                    insert.postlike_15        = r5._15;
                    insert.perday_postlike_15 = r5.perday_15;
                    insert.postlike_30        = r5._30;
                    insert.perday_postlike_30 = r5.perday_30;
                    insert.postlike_60        = r5._60;
                    insert.perday_postlike_60 = r5.perday_60;
                    insert.postlike_90        = r5._90;
                    insert.perday_postlike_90 = r5.perday_90;

                    insert.videopost_15        = r._15;
                    insert.perday_videopost_15 = r.perday_15;
                    insert.videopost_30        = r._30;
                    insert.perday_videopost_30 = r.perday_30;
                    insert.videopost_60        = r._60;
                    insert.perday_videopost_60 = r.perday_60;
                    insert.videopost_90        = r._90;
                    insert.perday_videopost_90 = r.perday_90;

                    insert.imagepost_15        = r1._15;
                    insert.perday_imagepost_15 = r1.perday_15;
                    insert.imagepost_30        = r1._30;
                    insert.perday_imagepost_30 = r1.perday_30;
                    insert.imagepost_60        = r1._60;
                    insert.perday_imagepost_60 = r1.perday_60;
                    insert.imagepost_90        = r1._90;
                    insert.perday_imagepost_90 = r1.perday_90;

                    string i = new JavaScriptSerializer().Serialize(insert);

                    ApiInstaReportObj.insertdata(i);
                }
                catch (Exception ex)
                {
                }
            }
        }
Пример #2
0
        private static void instagramreport()
        {

            Api.InstagramReports.InstagramReports ApiInstaReportObj = new Api.InstagramReports.InstagramReports();
            Api.Instagram.Instagram ApiInstaObj = new Api.Instagram.Instagram();

            Domain.Socioboard.Domain.InstagramReport insert = new Domain.Socioboard.Domain.InstagramReport();
            List<Domain.Socioboard.Domain.InstagramAccount> accounts = (List<Domain.Socioboard.Domain.InstagramAccount>)new JavaScriptSerializer().Deserialize(ApiInstaObj.getInstaAccounts(), typeof(List<Domain.Socioboard.Domain.InstagramAccount>));
            foreach (Domain.Socioboard.Domain.InstagramAccount account in accounts)
            {
                try
                {

                    Guid Id = Guid.NewGuid();
                    string Profile_Id = account.InstagramId;
                    Domain.Socioboard.Domain.InstagramUserDetails user_details = (Domain.Socioboard.Domain.InstagramUserDetails)new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramUserDetail(account.InstagramId), typeof(Domain.Socioboard.Domain.InstagramUserDetails));
                    string Insta_Name = user_details.Insta_Name;
                    string Full_Name = user_details.Full_Name;
                    string Media_count = user_details.Media_Count;
                    string Follower = user_details.Follower;
                    string Following = user_details.Following;
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(ApiInstaReportObj.GetVideoPosts(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("1");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r1 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(ApiInstaReportObj.GetImagePosts(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("2");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r2 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramFollowerGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("3");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r3 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramFollowingGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r4 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramPostCommentGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");
                    ApiInstaReportObj.Timeout = -1;
                    Domain.Socioboard.Domain.ReturnData r5 = (Domain.Socioboard.Domain.ReturnData)new JavaScriptSerializer().Deserialize(ApiInstaReportObj.InstagramPostLikesGained(account.InstagramId), typeof(Domain.Socioboard.Domain.ReturnData));
                    Console.WriteLine("4");

                    insert.Id = Id;
                    insert.Profile_Id = Profile_Id;
                    insert.Insta_Name = Insta_Name;
                    insert.Full_Name = Full_Name;
                    insert.Media_Count = Media_count;
                    insert.Follower = Follower;
                    insert.Following = Following;

                    insert.follow_15 = r2._15;
                    insert.perday_follow_15 = r2.perday_15;
                    insert.follow_30 = r1._30;
                    insert.perday_follow_30 = r2.perday_30;
                    insert.follow_60 = r2._60;
                    insert.perday_follow_60 = r2.perday_60;
                    insert.follow_90 = r2._90;
                    insert.perday_follow_90 = r2.perday_90;

                    insert.following_15 = r3._15;
                    insert.perday_following_15 = r3.perday_15;
                    insert.following_30 = r3._30;
                    insert.perday_following_30 = r3.perday_30;
                    insert.following_60 = r3._60;
                    insert.perday_following_60 = r3.perday_60;
                    insert.following_90 = r3._90;
                    insert.perday_following_90 = r3.perday_90;

                    insert.postcomment_15 = r4._15;
                    insert.perday_postcomment_15 = r4.perday_15;
                    insert.postcomment_30 = r4._30;
                    insert.perday_postcomment_30 = r4.perday_30;
                    insert.postcomment_60 = r4._60;
                    insert.perday_postcomment_60 = r4.perday_60;
                    insert.postcomment_90 = r4._90;
                    insert.perday_postcomment_90 = r4.perday_90;

                    insert.postlike_15 = r5._15;
                    insert.perday_postlike_15 = r5.perday_15;
                    insert.postlike_30 = r5._30;
                    insert.perday_postlike_30 = r5.perday_30;
                    insert.postlike_60 = r5._60;
                    insert.perday_postlike_60 = r5.perday_60;
                    insert.postlike_90 = r5._90;
                    insert.perday_postlike_90 = r5.perday_90;

                    insert.videopost_15 = r._15;
                    insert.perday_videopost_15 = r.perday_15;
                    insert.videopost_30 = r._30;
                    insert.perday_videopost_30 = r.perday_30;
                    insert.videopost_60 = r._60;
                    insert.perday_videopost_60 = r.perday_60;
                    insert.videopost_90 = r._90;
                    insert.perday_videopost_90 = r.perday_90;

                    insert.imagepost_15 = r1._15;
                    insert.perday_imagepost_15 = r1.perday_15;
                    insert.imagepost_30 = r1._30;
                    insert.perday_imagepost_30 = r1.perday_30;
                    insert.imagepost_60 = r1._60;
                    insert.perday_imagepost_60 = r1.perday_60;
                    insert.imagepost_90 = r1._90;
                    insert.perday_imagepost_90 = r1.perday_90;

                    string i = new JavaScriptSerializer().Serialize(insert);

                    ApiInstaReportObj.insertdata(i);
                }
                catch (Exception ex)
                {
                }

            }


        }