protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { User user = (User)Session["LoggedUser"]; if (user == null) { Response.Redirect("/Default.aspx"); } FacebookAccountRepository objFbRepo = new FacebookAccountRepository(); TeamMemberProfileRepository objTeamMemberProfileRepository = new TeamMemberProfileRepository(); SocioBoard.Domain.Team team = (SocioBoard.Domain.Team)Session["GroupName"]; List <TeamMemberProfile> allprofiles = objTeamMemberProfileRepository.getTeamMemberProfileData(team.Id); //List<FacebookAccount>arrfbPrfile=new List<FacebookAccount>(); ArrayList arrfbPrfile = new ArrayList(); try { foreach (TeamMemberProfile item in allprofiles) { //fbpId += item.ProfileId + ','; FacebookAccount arrfbProfile = objFbRepo.getAllFbAccountDetail(item.ProfileId); if (arrfbProfile.FbUserId != null) { arrfbPrfile.Add(arrfbProfile); } } } catch (Exception ex) { logger.Error(ex.Message); } //fbpId = fbpId.Substring(0, fbpId.Length - 1); //List<FacebookAccount> arrfbProfile = objFbRepo.getAllFbAccountDetail(fbpId); //ArrayList arrfbProfile = fbAccRepo.getAllFacebookPagesOfUser(user.Id); spandiv.InnerHtml = "from " + DateTime.Now.AddDays(-15).ToShortDateString() + "-" + DateTime.Now.ToShortDateString(); try { foreach (FacebookAccount item in arrfbPrfile) { string imgPath = "http://graph.facebook.com/" + item.FbUserId + "/picture"; fbUser = fbUser + "<div class=\"teitter\"><ul><li><a id=\"facebook_connect\" onclick='getProfilefbGraph(\"" + item.FbUserId + "\",\"" + item.FbUserName + "\",\"" + imgPath + "\",\"" + item.AccessToken + "\")'><span style=\"float:left;margin: 3px 0 0 5px;\" >" + item.FbUserName + "</span></a></li></ul></div>"; fbProfileId = item.FbUserId; Session["fbprofileId"] = fbProfileId; divPageName.InnerHtml = item.FbUserName; fbProfileImg.Src = "http://graph.facebook.com/" + item.FbUserId + "/picture"; strfbAccess = item.AccessToken; Session["acstknfnpg"] = strfbAccess; } } catch (Exception ex) { logger.Error(ex.Message); } if (arrfbPrfile.Count > 0) { try { getAllGroupsOnHome.InnerHtml = fbUser; strFbAgeArray = fbiHelper.getLikesByGenderAge(fbProfileId, 15); strPageImpression = fbiHelper.getPageImressions(fbProfileId, 15); strLocationArray = fbiHelper.getLocationInsight(fbProfileId, 15); strstoriesArray = fbiHelper.getStoriesCount(fbProfileId, 15); //divpost.InnerHtml = fbiHelper.getPostDetails(fbProfileId, user.Id, 15); likeunlikedate = objfbstatsHelper.getlikeUnlike(fbProfileId, 15); FacebookClient fb = new FacebookClient(); fb.AccessToken = strfbAccess; dynamic pagelikes = fb.Get(fbProfileId); divPageLikes.InnerHtml = pagelikes.likes.ToString() + " Total Likes " + pagelikes.talking_about_count + " People talking about this."; spanTalking.InnerHtml = pagelikes.talking_about_count.ToString(); string fanpost = PageFeed(strfbAccess, fbProfileId); divpost.InnerHtml = fanpost; } catch (Exception ex) { logger.Error(ex.Message); } } } } catch (Exception Err) { logger.Error(Err.Message); Response.Write(Err.Message); } }
protected void procesRequest() { if (Request.QueryString["op"] == "twitter") { string twtProfileId = Request.QueryString["id"].ToString(); Session["twtProfileId"] = twtProfileId; User user = (User)Session["LoggedUser"]; strTwtArray = objtwtStatsHelper.getNewFollowers(twtProfileId, 15); strTwtFollowing = objtwtStatsHelper.getNewFollowing(twtProfileId, 15); // strTwtAge = objtwtStatsHelper.GetFollowersAgeWise(user); strIncomingMsg = objtwtStatsHelper.getIncomingMsg(twtProfileId, 15); strDmRecieve = objtwtStatsHelper.getDirectMessageRecieve(twtProfileId, 15); strDMSent = objtwtStatsHelper.getDirectMessageSent(twtProfileId, 15); strSentMsg = objtwtStatsHelper.getSentMsg(twtProfileId, 15); strRetweet = objtwtStatsHelper.getRetweets(twtProfileId, 15); strAgeDiff = objtwtStatsRepo.getAgeDiffCount(twtProfileId, 15); strEngagement = objtwtStatsHelper.getEngagements(twtProfileId, 15); strInfluence = objtwtStatsHelper.getInfluence(twtProfileId, 15); strDatetwt = objtwtStatsHelper.getdate(twtProfileId, 15); strTwtMention = objtwtStatsHelper.getTwtMention(twtProfileId, 15); Response.Write(strTwtArray + "@" + strTwtFollowing + "@" + strIncomingMsg + "@" + strDmRecieve + "@" + strDMSent + "@" + strSentMsg + "@" + strRetweet + "@" + strAgeDiff + "@" + strEngagement + "@" + strInfluence + "@" + strTwtMention + "@" + strDatetwt); } if (Request.QueryString["op"] == "facebook") { string fbProfileId = Request.QueryString["id"].ToString(); Session["fbprofileId"] = fbProfileId; User user = (User)Session["LoggedUser"]; string nmbrdays = Request.QueryString["NumberOfDays"]; int NumberOfDays = Convert.ToInt16(nmbrdays); // objfbstatsHelper.getAllGroupsOnHome.InnerHtml = fbUser; try { // strFbAgeArray = objfbstatsHelper.getLikesByGenderAge(fbProfileId, 15); } catch (Exception ex) { logger.Error(ex.Message); } try { strPageImpression = objfbstatsHelper.getPageImressions(fbProfileId, 15); } catch (Exception ex) { logger.Error(ex.Message); } try { // strLocationArray = objfbstatsHelper.getLocationInsight(fbProfileId, 15); } catch (Exception ex) { logger.Error(ex.Message); } try { strstoriesArray = objfbstatsHelper.getStoriesCount(fbProfileId, 15); } catch (Exception ex) { logger.Error(ex.Message); } try { // objfbstatsHelper.getPostDetails(fbProfileId, user.Id, 15); } catch (Exception ex) { logger.Error(ex.Message); } try { // likeunlikedate = objfbstatsHelper.getlikeUnlike(fbProfileId, 15); } catch (Exception ex) { logger.Error(ex.Message); } string imgPath = "http://graph.facebook.com/" + fbProfileId + "/picture"; FacebookClient fb = new FacebookClient(); fb.AccessToken = Request.QueryString["access"].ToString(); dynamic pagelikes = fb.Get(fbProfileId); string strval = pagelikes.likes.ToString() + " Total Likes " + pagelikes.talking_about_count + " People talking about this."; string PeopleTalkingAboutThis = pagelikes.talking_about_count.ToString(); string acstkn = Request.QueryString["access"].ToString(); Session["acstknfnpg"] = acstkn; string fanpost = PageFeed(acstkn, fbProfileId); //divpost.InnerHtml = fanpost; //Response.Write(strFbAgeArray + "_" + strPageImpression + "_" + strLocationArray + "_" + strval + "_" + PeopleTalkingAboutThis + "_" + likeunlikedate + "_" + imgPath + "_" + strstoriesArray + "_" + fanpost); Response.Write(strPageImpression + "_" + strval + "_" + PeopleTalkingAboutThis + "_" + imgPath + "_" + strstoriesArray + "_" + fanpost); } }