Esempio n. 1
0
        public override async void Initialize(TwitterAccount account,SettingData setting, Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
        {
            base.Initialize(account,setting, timelineActionCallback, rowActionCallback);

            ChangeLoadState(true);
            
            if (TimeLine.Count > 0)
            {
                string sinceId = (TimeLine.First() as DirectMessageRow).DirectMessage.id_str;
                var dms = await Account.TwitterClient.GetDirectMessages(sinceId);
                var sents = await Account.TwitterClient.GetDirectMessageSent(sinceId);
                dms.AddRange(sents);
                dms.Sort();
                dms.Reverse();

                var dmRows = dms.Select(d => new DirectMessageRow(d, Account.UserInfomation.screen_name, Setting,rowActionCallback)).Cast<RowBase>().ToList();
                await InsertRestInTimeLineAsync(dmRows);
            }
            else
            {
                var dms = await Account.TwitterClient.GetDirectMessages();
                var sents = await Account.TwitterClient.GetDirectMessageSent();
                dms.AddRange(sents);
                dms.Sort();
                dms.Reverse();
                var dmRows = dms.Select(d => new DirectMessageRow(d, Account.UserInfomation.screen_name, Setting,rowActionCallback)).Cast<RowBase>().ToList();
                await InsertRestInTimeLineAsync(dmRows);
            }

            ChangeLoadState(false);
        }
Esempio n. 2
0
 public SearchTimeline(TwitterAccount account, string listTitle, string tabName, string searchWord,SettingData setting, Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
     : base(account, listTitle, tabName, TimelineType.Search,setting,timelineActionCallback,rowActionCallback)
 {
     this.SearchWord = searchWord;
     
     Initialize(account,setting,timelineActionCallback,rowActionCallback);
 }
Esempio n. 3
0
        /// <summary>
        ///		Obtiene la salida de una URL
        /// </summary>
        internal static MLFile GetResponse(TwitterAccount objAccount, string strURL, ParameterDataCollection objColParameters, bool blnPost)
        {
            try
                {	RestController objController = new RestController();
                    oAuthAuthenticator objAuthenticator = new oAuthAuthenticator();
                    RequestMessage objRequest = new RequestMessage(RequestMessage.MethodType.Get, strURL);
                    ResponseMessage objResponse;

                        // Asigna las propiedades al autentificador
                            objAuthenticator.ConsumerKey = objAccount.Manager.OAuthConsumerKey;
                            objAuthenticator.ConsumerSecret = objAccount.Manager.OAuthConsumerSecret;
                            objAuthenticator.AccessToken = objAccount.OAuthToken;
                            objAuthenticator.AccessTokenSecret = objAccount.OAuthTokenSecret;
                        // Asigna el autentificador
                            objController.Authenticator = objAuthenticator;
                        // Asigna el método de envío
                            if (blnPost)
                                objRequest.Method = RequestMessage.MethodType.Post;
                        // Asigna los parámetros
                            if (objColParameters != null)
                                foreach (ParameterData objParameter in objColParameters)
                                    objRequest.QueryParameters.Add(objParameter.Key, objParameter.Value);
                        // Envía el mensaje
                            objResponse = objController.Send(objRequest);
                        // Devuelve el documento JSON
                            if (objResponse.IsError)
                                return GetError("Error en la recepción. Status: " + objResponse.ErrorDescription);
                            else
                                return new Bau.Libraries.LibMarkupLanguage.MLSerializer().ParseText(objResponse.Body);
                    }
                catch (Exception objException)
                    { return GetError(objException);
                    }
        }
Esempio n. 4
0
        public static void CompleteAccountProvision(string accountName, OAuthTokenResponse RequestToken, string VerificationString)
        {
            OAuthTokenResponse accessToken = OAuthUtility.GetAccessToken(Twitter_ConsumerKey, Twitter_ConsumerSecret, RequestToken.Token, VerificationString);
            TwitterAccount account = new TwitterAccount(accountName, accessToken, VerificationString);

            TwitterAccounts.Add(account);

            AddAccountToDB(account);
        }
Esempio n. 5
0
		protected Connector(TwitterAccount account)
		{
			this.Account = account;
			this._IsAvailable = NetworkInterface.GetIsNetworkAvailable();

			this.compositeDisposable.Add(
				new EventListener<NetworkAvailabilityChangedEventHandler>(
					h => NetworkChange.NetworkAvailabilityChanged += h,
					h => NetworkChange.NetworkAvailabilityChanged -= h,
					(sender, e) => this.IsAvailable = e.IsAvailable));
		}
        internal TwitterWrapper(string friendlyName, string user)
        {
            account = new TwitterAccount();

            TwitterPlugin.TwitterData.TwitterAccounts.InsertOnSubmit(account);

            account.FriendlyName = friendlyName;
            account.UserName = user;
            account.LastMessage = DateTime.Now;

            CreateNewRequestToken();
        }
Esempio n. 7
0
		private static async Task<TwitterAccount> LoadAccount(string path)
		{
			var settings = path.ReadXml<AccountSettings>();
			var account = new TwitterAccount(settings.Tokens.Select(st => st.ToTwitterToken()));
			account.CurrentToken = account.Tokens.FirstOrDefault(t => t.Application.Id == settings.CurrentApplicationId) 
				?? account.Tokens.FirstOrDefault();
			account.UserStreams.UseUserStreams = settings.UseUserStreams;

			account.UserId = account.CurrentToken.ToUserId();
			await account.Initialize();

			return account;
		}
Esempio n. 8
0
        public void TwitterGetSnapshot()
        {
            TwitterAccount twitterAccount = new TwitterAccount { Id = "sanjosesharks", FriendlyName = "San Jose Sharks" };
            TwitterSnapshot twitterAccountSnapshot = TwitterQuery.GetTwitterSnapshot(twitterAccount);

            Assert.AreEqual(DateTime.UtcNow.Date, twitterAccountSnapshot.DateOfSnapshot.Date, "The snapshot is from today");
            Assert.IsTrue(twitterAccountSnapshot.Tweets > 0, "There are more than 0 tweets");
            Assert.IsTrue(twitterAccountSnapshot.Following > 0, "There are more than 0 following");
            Assert.IsTrue(twitterAccountSnapshot.Followers > 0, "There are more than 0 followers");
            Assert.AreEqual(twitterAccount.Id, twitterAccountSnapshot.TwitterAccountId, "There account name is correct in the snapshot");

            Assert.AreEqual("sanjosesharks", twitterAccountSnapshot.TwitterAccountId, "There account name is sanjosesharks");
        }
Esempio n. 9
0
        public override async void Initialize(TwitterAccount account,SettingData setting, Action<TimelineAction> timelineActionCallback, Action<Row.RowAction> rowActionCallback)
        {
            base.Initialize(account,setting, timelineActionCallback, rowActionCallback);

            
            await InsertRestInTimeLineAsync((await Account.TwitterClient.GetSearchAsync(SearchWord)).statuses.Select(q=>new TimelineRow(q,Account.UserInfomation.screen_name,Setting,rowActionCallback)).Cast<RowBase>().ToList());

            trackStream = new TrackStream(account.TwitterClient.ConsumerData, account.TwitterClient.AccessToken, account.UserInfomation, searchWord);
            
            trackStream.ConnectStreamAsync();
            trackStream.GetStreamTrack += async(tweet) =>
            {
                await InsertStreamInTimeLineAsync(new TimelineRow(tweet,Account.UserInfomation.screen_name,Setting,rowActionCallback));
            };
        }
Esempio n. 10
0
 public override async void Initialize(TwitterAccount account,SettingData setting, Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
 {
     base.Initialize(account,setting, timelineActionCallback, rowActionCallback);
     if (TimeLine.Count > 0)
     {
         var t = TimeLine.First() as TimelineRow;
         
         var rows = (await Account.TwitterClient.GetListAsync(TwitterList,t.Tweet.id_str)).Select(r => new TimelineRow(r, Account.UserInfomation.screen_name,Setting, rowActionCallback)).Cast<RowBase>().ToList();
         await InsertRestInTimeLineAsync(rows);
     }
     else
     {
         var rows = (await Account.TwitterClient.GetListAsync(TwitterList)).Select(r => new TimelineRow(r, Account.UserInfomation.screen_name,Setting, rowActionCallback)).Cast<RowBase>().ToList();
         await InsertRestInTimeLineAsync(rows);
     }
     
 }
Esempio n. 11
0
        public override async void Initialize(TwitterAccount account,SettingData setting, Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
        {
            base.Initialize(account,setting, timelineActionCallback, rowActionCallback);
            ChangeLoadState(true);

            if (TimeLine.Count > 0)
            {
                string sinceId = (TimeLine.First() as TimelineRow).Tweet.id_str;

                var rows = (await Account.TwitterClient.GetMentionTimelineNewAsync(sinceId)).Select(r => new TimelineRow(r, Account.UserInfomation.screen_name,Setting, rowActionCallback)).Cast<RowBase>().ToList();
                await InsertRestInTimeLineAsync(rows);
            }
            else
            {
                var rows = (await Account.TwitterClient.GetMentionTimelineAsync(200)).Select(r => new TimelineRow(r, Account.UserInfomation.screen_name,Setting, rowActionCallback)).Cast<RowBase>().ToList();
                await InsertRestInTimeLineAsync(rows);
            }
            ChangeLoadState(false);
        }
Esempio n. 12
0
		public async Task GetAccessToken(string pinCode)
		{
			var data = await TwitterClient.Current.GetAccessToken(
				this.application.ConsumerKey, 
				this.application.ConsumerSecret, 
				this.requestToken,
				pinCode).ToTask();

			var account = TwitterClient.Current.Accounts.FirstOrDefault(a => a.UserId == data.UserId);
			if (account == null)
			{
				account = new TwitterAccount(this.application, data.Token);
				await account.Initialize();
				TwitterClient.Current.LoadAccount(account);
			}
			else
			{
				account.AddToken(this.application, data.Token);
			}
		}
Esempio n. 13
0
 public ListTimeline(TwitterAccount account, string listTitle, string tabName,TwitterList list,SettingData setting,Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
     : base(account, listTitle, tabName, TimelineType.List,setting,timelineActionCallback,rowActionCallback)
 {
     this.TwitterList = list;
     Initialize(account,setting, timelineActionCallback, rowActionCallback);
 }
Esempio n. 14
0
 public override Task <TwitterFriendship> Send(TwitterAccount account)
 {
     return(account.UpdateFriendshipAsync(_userId, _deviceNotifications, _showRetweets));
 }
Esempio n. 15
0
        protected void btnRegister_Click(object sender, ImageClickEventArgs e)
        {
            User           user     = new User();
            UserRepository userrepo = new UserRepository();

            SocioBoard.Helper.SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
            try
            {
                if (txtPassword.Text == txtConfirmPassword.Text)
                {
                    user.PaymentStatus = "unpaid";
                    user.AccountType   = Request.QueryString["type"];
                    if (user.AccountType == string.Empty)
                    {
                        user.AccountType = AccountType.Deluxe.ToString();
                    }
                    user.CreateDate = DateTime.Now;
                    user.ExpiryDate = DateTime.Now.AddMonths(1);
                    user.Id         = Guid.NewGuid();
                    user.UserName   = txtFirstName.Text + " " + txtLastName.Text;
                    user.Password   = this.MD5Hash(txtPassword.Text);
                    user.EmailId    = txtEmail.Text;
                    user.UserStatus = 1;
                    if (!userrepo.IsUserExist(user.EmailId))
                    {
                        UserRepository.Add(user);
                        SocioBoard.Helper.MailSender.SendEMail(txtFirstName.Text + " " + txtLastName.Text, txtPassword.Text, txtEmail.Text);

                        TeamRepository teamRepo = new TeamRepository();
                        Team           team     = teamRepo.getTeamByEmailId(txtEmail.Text);
                        if (team != null)
                        {
                            Guid teamid = Guid.Parse(Request.QueryString["tid"]);
                            teamRepo.updateTeamStatus(teamid);


                            TeamMemberProfileRepository teamMemRepo   = new TeamMemberProfileRepository();
                            List <TeamMemberProfile>    lstteammember = teamMemRepo.getAllTeamMemberProfilesOfTeam(team.Id);
                            foreach (TeamMemberProfile item in lstteammember)
                            {
                                try
                                {
                                    SocialProfilesRepository socialRepo   = new SocialProfilesRepository();
                                    SocialProfile            socioprofile = new SocialProfile();
                                    socioprofile.Id          = Guid.NewGuid();
                                    socioprofile.ProfileDate = DateTime.Now;
                                    socioprofile.ProfileId   = item.ProfileId;
                                    socioprofile.ProfileType = item.ProfileType;
                                    socioprofile.UserId      = user.Id;
                                    socialRepo.addNewProfileForUser(socioprofile);

                                    if (item.ProfileType == "facebook")
                                    {
                                        try
                                        {
                                            FacebookAccount           fbAccount     = new FacebookAccount();
                                            FacebookAccountRepository fbAccountRepo = new FacebookAccountRepository();
                                            FacebookAccount           userAccount   = fbAccountRepo.getUserDetails(item.ProfileId);
                                            fbAccount.AccessToken = userAccount.AccessToken;
                                            fbAccount.EmailId     = userAccount.EmailId;
                                            fbAccount.FbUserId    = item.ProfileId;
                                            fbAccount.FbUserName  = userAccount.FbUserName;
                                            fbAccount.Friends     = userAccount.Friends;
                                            fbAccount.Id          = Guid.NewGuid();
                                            fbAccount.IsActive    = true;
                                            fbAccount.ProfileUrl  = userAccount.ProfileUrl;
                                            fbAccount.Type        = userAccount.Type;
                                            fbAccount.UserId      = user.Id;
                                            fbAccountRepo.addFacebookUser(fbAccount);
                                        }
                                        catch (Exception ex)
                                        {
                                            Console.WriteLine(ex.Message);
                                            logger.Error(ex.Message);
                                        }
                                    }
                                    else if (item.ProfileType == "twitter")
                                    {
                                        try
                                        {
                                            TwitterAccount           twtAccount = new TwitterAccount();
                                            TwitterAccountRepository twtAccRepo = new TwitterAccountRepository();
                                            TwitterAccount           twtAcc     = twtAccRepo.getUserInfo(item.ProfileId);
                                            twtAccount.FollowersCount    = twtAcc.FollowersCount;
                                            twtAccount.FollowingCount    = twtAcc.FollowingCount;
                                            twtAccount.Id                = Guid.NewGuid();
                                            twtAccount.IsActive          = true;
                                            twtAccount.OAuthSecret       = twtAcc.OAuthSecret;
                                            twtAccount.OAuthToken        = twtAcc.OAuthToken;
                                            twtAccount.ProfileImageUrl   = twtAcc.ProfileImageUrl;
                                            twtAccount.ProfileUrl        = twtAcc.ProfileUrl;
                                            twtAccount.TwitterName       = twtAcc.TwitterName;
                                            twtAccount.TwitterScreenName = twtAcc.TwitterScreenName;
                                            twtAccount.TwitterUserId     = twtAcc.TwitterUserId;
                                            twtAccount.UserId            = user.Id;
                                            twtAccRepo.addTwitterkUser(twtAccount);
                                        }
                                        catch (Exception ex)
                                        {
                                            Console.WriteLine(ex.StackTrace);
                                            logger.Error(ex.Message);
                                        }
                                    }
                                    else if (item.ProfileType == "instagram")
                                    {
                                        try
                                        {
                                            InstagramAccount           insAccount = new InstagramAccount();
                                            InstagramAccountRepository insAccRepo = new InstagramAccountRepository();
                                            InstagramAccount           InsAcc     = insAccRepo.getInstagramAccountById(item.ProfileId);
                                            insAccount.AccessToken = InsAcc.AccessToken;
                                            insAccount.FollowedBy  = InsAcc.FollowedBy;
                                            insAccount.Followers   = InsAcc.Followers;
                                            insAccount.Id          = Guid.NewGuid();
                                            insAccount.InstagramId = item.ProfileId;
                                            insAccount.InsUserName = InsAcc.InsUserName;
                                            insAccount.IsActive    = true;
                                            insAccount.ProfileUrl  = InsAcc.ProfileUrl;
                                            insAccount.TotalImages = InsAcc.TotalImages;
                                            insAccount.UserId      = user.Id;
                                            insAccRepo.addInstagramUser(insAccount);
                                        }
                                        catch (Exception ex)
                                        {
                                            Console.WriteLine(ex.StackTrace);
                                            logger.Error(ex.Message);
                                        }
                                    }
                                    else if (item.ProfileType == "linkedin")
                                    {
                                        try
                                        {
                                            LinkedInAccount           linkAccount       = new LinkedInAccount();
                                            LinkedInAccountRepository linkedAccountRepo = new LinkedInAccountRepository();
                                            LinkedInAccount           linkAcc           = linkedAccountRepo.getLinkedinAccountDetailsById(item.ProfileId);
                                            linkAccount.Id               = Guid.NewGuid();
                                            linkAccount.IsActive         = true;
                                            linkAccount.LinkedinUserId   = item.ProfileId;
                                            linkAccount.LinkedinUserName = linkAcc.LinkedinUserName;
                                            linkAccount.OAuthSecret      = linkAcc.OAuthSecret;
                                            linkAccount.OAuthToken       = linkAcc.OAuthToken;
                                            linkAccount.OAuthVerifier    = linkAcc.OAuthVerifier;
                                            linkAccount.ProfileImageUrl  = linkAcc.ProfileImageUrl;
                                            linkAccount.ProfileUrl       = linkAcc.ProfileUrl;
                                            linkAccount.UserId           = user.Id;
                                            linkedAccountRepo.addLinkedinUser(linkAccount);
                                        }
                                        catch (Exception ex)
                                        {
                                            Console.WriteLine(ex.StackTrace);
                                            logger.Error(ex.Message);
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    logger.Error(ex.Message);
                                }
                            }
                        }


                        lblerror.Text = "Registered Successfully !" + "<a href=\"Default.aspx\">Login</a>";
                    }
                    else
                    {
                        lblerror.Text = "Email Already Exists " + "<a href=\"Default.aspx\">login</a>";
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.StackTrace);
                lblerror.Text = "Please Insert Correct Information";
                Console.WriteLine(ex.StackTrace);
            }
        }
Esempio n. 16
0
 private static void AddAccountToDB(TwitterAccount account)
 {
     string accessTokenString = SerializationHelper.Serialize(typeof(OAuthTokenResponse), account.AccessToken);
     DataAccess.AddTwitterAccount(account.AccountName, accessTokenString, account.VerificationString);
 }
 public SelectableAccountViewModel(AccountSelectionFlipViewModel parent, TwitterAccount account, Action onSelectionChanged)
 {
     this._parent             = parent;
     this._account            = account;
     this._onSelectionChanged = onSelectionChanged;
 }
Esempio n. 18
0
 public FallbackedEvent(TwitterAccount account, TwitterAccount fallbackTo)
 {
     _account         = account;
     _fallbackAccount = fallbackTo;
 }
 public DirectMessageCommands(TwitterAccount objAccount)
     : base(objAccount)
 {
 }
Esempio n. 20
0
        protected void btnRegister_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                User             user                = new User();
                UserRepository   userrepo            = new UserRepository();
                UserActivation   objUserActivation   = new UserActivation();
                Coupon           objCoupon           = new Coupon();
                CouponRepository objCouponRepository = new CouponRepository();
                Groups           groups              = new Groups();
                GroupRepository  objGroupRepository  = new GroupRepository();
                Team             teams               = new Team();
                TeamRepository   objTeamRepository   = new TeamRepository();


                SocioBoard.Helper.SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
                try
                {
                    if (DropDownList1.SelectedValue == "Free" || DropDownList1.SelectedValue == "Standard" || DropDownList1.SelectedValue == "Deluxe" || DropDownList1.SelectedValue == "Premium" || DropDownList1.SelectedValue == "SocioBasic" || DropDownList1.SelectedValue == "SocioStandard" || DropDownList1.SelectedValue == "SocioPremium" || DropDownList1.SelectedValue == "SocioDeluxe")


                    {
                        if (TextBox1.Text.Trim() != "")
                        {
                            string resp = SBUtils.GetCouponStatus(TextBox1.Text).ToString();
                            if (resp != "valid")
                            {
                                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + resp + "');", true);
                                return;
                            }
                        }



                        if (txtPassword.Text == txtConfirmPassword.Text)
                        {
                            user.PaymentStatus = "unpaid";
                            user.AccountType   = DropDownList1.SelectedValue.ToString();
                            if (string.IsNullOrEmpty(user.AccountType))
                            {
                                user.AccountType = AccountType.Free.ToString();
                            }


                            user.CreateDate       = DateTime.Now;
                            user.ExpiryDate       = DateTime.Now.AddDays(30);
                            user.Id               = Guid.NewGuid();
                            user.UserName         = txtFirstName.Text + " " + txtLastName.Text;
                            user.Password         = this.MD5Hash(txtPassword.Text);
                            user.EmailId          = txtEmail.Text;
                            user.UserStatus       = 1;
                            user.ActivationStatus = "0";

                            if (TextBox1.Text.Trim() != "")
                            {
                                user.CouponCode = TextBox1.Text.Trim().ToString();
                            }


                            if (!userrepo.IsUserExist(user.EmailId))
                            {
                                logger.Error("Before User reg");
                                UserRepository.Add(user);



                                try
                                {
                                    groups.Id        = Guid.NewGuid();
                                    groups.GroupName = ConfigurationManager.AppSettings["DefaultGroupName"];
                                    groups.UserId    = user.Id;
                                    groups.EntryDate = DateTime.Now;

                                    objGroupRepository.AddGroup(groups);


                                    teams.Id      = Guid.NewGuid();
                                    teams.GroupId = groups.Id;
                                    teams.UserId  = user.Id;
                                    teams.EmailId = user.EmailId;

                                    objTeamRepository.addNewTeam(teams);



                                    BusinessSettingRepository busnrepo = new BusinessSettingRepository();

                                    SocioBoard.Domain.BusinessSetting objbsnssetting = new SocioBoard.Domain.BusinessSetting();

                                    if (!busnrepo.checkBusinessExists(user.Id, groups.GroupName))
                                    {
                                        objbsnssetting.Id               = Guid.NewGuid();
                                        objbsnssetting.BusinessName     = groups.GroupName;
                                        objbsnssetting.GroupId          = groups.Id;
                                        objbsnssetting.AssigningTasks   = false;
                                        objbsnssetting.AssigningTasks   = false;
                                        objbsnssetting.TaskNotification = false;
                                        objbsnssetting.TaskNotification = false;
                                        objbsnssetting.FbPhotoUpload    = 0;
                                        objbsnssetting.UserId           = user.Id;
                                        objbsnssetting.EntryDate        = DateTime.Now;
                                        busnrepo.AddBusinessSetting(objbsnssetting);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                    logger.Error("Error : " + ex.Message);
                                    logger.Error("Error : " + ex.StackTrace);
                                }


                                try
                                {
                                    logger.Error("1 Request.QueryString[refid]");
                                    if (Request.QueryString["refid"] != null)
                                    {
                                        logger.Error("3 Request.QueryString[refid]");
                                        User UserValid = null;
                                        if (IsUserValid(Request.QueryString["refid"].ToString(), ref UserValid))
                                        {
                                            logger.Error("Inside IsUserValid");
                                            user.RefereeStatus = "1";
                                            UpdateUserReference(UserValid);
                                            AddUserRefreeRelation(user, UserValid);

                                            logger.Error("IsUserValid");
                                        }
                                        else
                                        {
                                            user.RefereeStatus = "0";
                                        }
                                    }
                                    logger.Error("2 Request.QueryString[refid]");
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                    logger.Error("btnRegister_Click" + ex.Message);
                                    logger.Error("btnRegister_Click" + ex.StackTrace);
                                }



                                if (TextBox1.Text.Trim() != "")
                                {
                                    objCoupon.CouponCode = TextBox1.Text.Trim();
                                    List <Coupon> lstCoupon = objCouponRepository.GetCouponByCouponCode(objCoupon);
                                    objCoupon.Id = lstCoupon[0].Id;
                                    objCoupon.EntryCouponDate = lstCoupon[0].EntryCouponDate;
                                    objCoupon.ExpCouponDate   = lstCoupon[0].ExpCouponDate;
                                    objCoupon.Status          = "1";
                                    objCouponRepository.SetCouponById(objCoupon);
                                }

                                Session["LoggedUser"]              = user;
                                objUserActivation.Id               = Guid.NewGuid();
                                objUserActivation.UserId           = user.Id;
                                objUserActivation.ActivationStatus = "0";
                                UserActivationRepository.Add(objUserActivation);

                                //add package start

                                UserPackageRelation           objUserPackageRelation           = new UserPackageRelation();
                                UserPackageRelationRepository objUserPackageRelationRepository = new UserPackageRelationRepository();
                                PackageRepository             objPackageRepository             = new PackageRepository();

                                try
                                {
                                    Package objPackage = objPackageRepository.getPackageDetails(user.AccountType);
                                    objUserPackageRelation.Id            = Guid.NewGuid();
                                    objUserPackageRelation.PackageId     = objPackage.Id;
                                    objUserPackageRelation.UserId        = user.Id;
                                    objUserPackageRelation.ModifiedDate  = DateTime.Now;
                                    objUserPackageRelation.PackageStatus = true;

                                    objUserPackageRelationRepository.AddUserPackageRelation(objUserPackageRelation);
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }

                                //end package

                                SocioBoard.Helper.MailSender.SendEMail(txtFirstName.Text, txtPassword.Text, txtEmail.Text, user.AccountType.ToString(), user.Id.ToString());
                                TeamRepository teamRepo = new TeamRepository();
                                try
                                {
                                    Team team = teamRepo.getTeamByEmailId(txtEmail.Text);
                                    if (team != null)
                                    {
                                        Guid teamid = Guid.Parse(Request.QueryString["tid"]);
                                        teamRepo.updateTeamStatus(teamid);
                                        TeamMemberProfileRepository teamMemRepo   = new TeamMemberProfileRepository();
                                        List <TeamMemberProfile>    lstteammember = teamMemRepo.getAllTeamMemberProfilesOfTeam(team.Id);
                                        foreach (TeamMemberProfile item in lstteammember)
                                        {
                                            try
                                            {
                                                SocialProfilesRepository socialRepo   = new SocialProfilesRepository();
                                                SocialProfile            socioprofile = new SocialProfile();
                                                socioprofile.Id          = Guid.NewGuid();
                                                socioprofile.ProfileDate = DateTime.Now;
                                                socioprofile.ProfileId   = item.ProfileId;
                                                socioprofile.ProfileType = item.ProfileType;
                                                socioprofile.UserId      = user.Id;
                                                socialRepo.addNewProfileForUser(socioprofile);

                                                if (item.ProfileType == "facebook")
                                                {
                                                    try
                                                    {
                                                        FacebookAccount           fbAccount     = new FacebookAccount();
                                                        FacebookAccountRepository fbAccountRepo = new FacebookAccountRepository();
                                                        FacebookAccount           userAccount   = fbAccountRepo.getUserDetails(item.ProfileId);
                                                        fbAccount.AccessToken = userAccount.AccessToken;
                                                        fbAccount.EmailId     = userAccount.EmailId;
                                                        fbAccount.FbUserId    = item.ProfileId;
                                                        fbAccount.FbUserName  = userAccount.FbUserName;
                                                        fbAccount.Friends     = userAccount.Friends;
                                                        fbAccount.Id          = Guid.NewGuid();
                                                        fbAccount.IsActive    = 1;
                                                        fbAccount.ProfileUrl  = userAccount.ProfileUrl;
                                                        fbAccount.Type        = userAccount.Type;
                                                        fbAccount.UserId      = user.Id;
                                                        fbAccountRepo.addFacebookUser(fbAccount);
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        Console.WriteLine(ex.Message);
                                                        logger.Error(ex.Message);
                                                    }
                                                }
                                                else if (item.ProfileType == "twitter")
                                                {
                                                    try
                                                    {
                                                        TwitterAccount           twtAccount = new TwitterAccount();
                                                        TwitterAccountRepository twtAccRepo = new TwitterAccountRepository();
                                                        TwitterAccount           twtAcc     = twtAccRepo.getUserInfo(item.ProfileId);
                                                        twtAccount.FollowersCount    = twtAcc.FollowersCount;
                                                        twtAccount.FollowingCount    = twtAcc.FollowingCount;
                                                        twtAccount.Id                = Guid.NewGuid();
                                                        twtAccount.IsActive          = true;
                                                        twtAccount.OAuthSecret       = twtAcc.OAuthSecret;
                                                        twtAccount.OAuthToken        = twtAcc.OAuthToken;
                                                        twtAccount.ProfileImageUrl   = twtAcc.ProfileImageUrl;
                                                        twtAccount.ProfileUrl        = twtAcc.ProfileUrl;
                                                        twtAccount.TwitterName       = twtAcc.TwitterName;
                                                        twtAccount.TwitterScreenName = twtAcc.TwitterScreenName;
                                                        twtAccount.TwitterUserId     = twtAcc.TwitterUserId;
                                                        twtAccount.UserId            = user.Id;
                                                        twtAccRepo.addTwitterkUser(twtAccount);
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        Console.WriteLine(ex.StackTrace);
                                                        logger.Error(ex.Message);
                                                    }
                                                }
                                                else if (item.ProfileType == "instagram")
                                                {
                                                    try
                                                    {
                                                        InstagramAccount           insAccount = new InstagramAccount();
                                                        InstagramAccountRepository insAccRepo = new InstagramAccountRepository();
                                                        InstagramAccount           InsAcc     = insAccRepo.getInstagramAccountById(item.ProfileId);
                                                        insAccount.AccessToken = InsAcc.AccessToken;
                                                        insAccount.FollowedBy  = InsAcc.FollowedBy;
                                                        insAccount.Followers   = InsAcc.Followers;
                                                        insAccount.Id          = Guid.NewGuid();
                                                        insAccount.InstagramId = item.ProfileId;
                                                        insAccount.InsUserName = InsAcc.InsUserName;
                                                        insAccount.IsActive    = true;
                                                        insAccount.ProfileUrl  = InsAcc.ProfileUrl;
                                                        insAccount.TotalImages = InsAcc.TotalImages;
                                                        insAccount.UserId      = user.Id;
                                                        insAccRepo.addInstagramUser(insAccount);
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        Console.WriteLine(ex.StackTrace);
                                                        logger.Error(ex.Message);
                                                    }
                                                }
                                                else if (item.ProfileType == "linkedin")
                                                {
                                                    try
                                                    {
                                                        LinkedInAccount           linkAccount       = new LinkedInAccount();
                                                        LinkedInAccountRepository linkedAccountRepo = new LinkedInAccountRepository();
                                                        LinkedInAccount           linkAcc           = linkedAccountRepo.getLinkedinAccountDetailsById(item.ProfileId);
                                                        linkAccount.Id               = Guid.NewGuid();
                                                        linkAccount.IsActive         = true;
                                                        linkAccount.LinkedinUserId   = item.ProfileId;
                                                        linkAccount.LinkedinUserName = linkAcc.LinkedinUserName;
                                                        linkAccount.OAuthSecret      = linkAcc.OAuthSecret;
                                                        linkAccount.OAuthToken       = linkAcc.OAuthToken;
                                                        linkAccount.OAuthVerifier    = linkAcc.OAuthVerifier;
                                                        linkAccount.ProfileImageUrl  = linkAcc.ProfileImageUrl;
                                                        linkAccount.ProfileUrl       = linkAcc.ProfileUrl;
                                                        linkAccount.UserId           = user.Id;
                                                        linkedAccountRepo.addLinkedinUser(linkAccount);
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        Console.WriteLine(ex.StackTrace);
                                                        logger.Error(ex.Message);
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                logger.Error(ex.Message);
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }

                                #region SetInvitationStatusAfterSuccessfulRegistration
                                try
                                {
                                    if (Request.QueryString["refid"] != null)
                                    {
                                        string refid = Request.QueryString["refid"];

                                        int res = SetInvitationStatusAfterSuccessfulRegistration(refid, txtEmail.Text);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    logger.Error(ex.Message);
                                }
                                #endregion


                                try
                                {
                                    lblerror.Text = "Registered Successfully !" + "<a href=\"Default.aspx\">Login</a>";
                                    Response.Redirect("~/Home.aspx");
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }
                            }
                            else
                            {
                                lblerror.Text = "Email Already Exists " + "<a id=\"loginlink\"  href=\"#\">login</a>";
                            }
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please select Account Type!');", true);
                    }
                }

                catch (Exception ex)
                {
                    logger.Error(ex.StackTrace);
                    lblerror.Text = "Success!";
                    Console.WriteLine(ex.StackTrace);
                    //Response.Redirect("Home.aspx");
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.StackTrace);

                Console.WriteLine(ex.StackTrace);
                //Response.Redirect("Home.aspx");
            }
        }
Esempio n. 21
0
 public DirectMessagesReceiver(TwitterAccount account)
 {
     this._account = account;
 }
Esempio n. 22
0
		internal NewStatus(TwitterAccount account)
		{
			this.Text = "";
			this.InReplyTo = null;
			this.MediaPaths = new ObservableSynchronizedCollection<string>();
			this.MediaPaths.CollectionChanged += (sender, e) => this.RaiseAllPropertyChanged();

			this._Account = account;
			this._State = new Normal(account);

			// 自身のプロパティ変更通知イベントを監視
			// Text の変更を検出し、最後の変更から 1000 ミリ秒間変更がなければ、入力中のツイートを分析
			this.analyzer = Observable.FromEventPattern<PropertyChangedEventHandler, PropertyChangedEventArgs>(
				h => this.PropertyChanged += h,
				h => this.PropertyChanged -= h)
				.Where(e => e.EventArgs.PropertyName == "Text")
				.Throttle(TimeSpan.FromMilliseconds(1000))
				.Subscribe(_ => this.AnalyzeCore());
		}
		public static QueryFilter Create(string query, TwitterAccount account)
		{
			ReversePolishNotation rpn;
			try
			{
				rpn = ReversePolishNotation.Convert(query);
			}
			catch (InvalidExpressionException ex)
			{
				throw new FilterException(ex.Message, ex);
			}
			catch (Exception ex)
			{
				throw new FilterException("クエリの解析中に不明なエラーが発生しました: " + ex.Message, ex);
			}

			var stack = new Stack<Expression<Func<Status, bool>>>();
			try
			{
				foreach (var token in rpn.Tokens)
				{
					if (token.IsSymbol())
					{
						if (token.IsAnd())
						{
							var left = stack.Pop();
							var right = stack.Pop();
							var visitor = new ParameterVisitor(left.Parameters);
							var exp = Expression.Lambda<Func<Status, bool>>(
								Expression.AndAlso(left.Body, visitor.Visit(right.Body)),
								visitor.Parameters);
							stack.Push(exp);
						}
						else if (token.IsOr())
						{
							var left = stack.Pop();
							var right = stack.Pop();
							var visitor = new ParameterVisitor(left.Parameters);
							var exp = Expression.Lambda<Func<Status, bool>>(
								Expression.OrElse(left.Body, visitor.Visit(right.Body)),
								visitor.Parameters);
							stack.Push(exp);
						}
						else if (token.IsNot())
						{
							var target = stack.Pop();
							var exp = Expression.Lambda<Func<Status, bool>>(
								Expression.Not(target.Body),
								target.Parameters);
							stack.Push(exp);
						}
					}
					else
					{
						stack.Push(GetFilterExpression(token, account));
					}
				}

				var result = stack.Pop();

				return new QueryFilter(query, result.Compile());
			}
			catch (FilterException)
			{
				throw;
			}
			catch (Exception ex)
			{
				throw new FilterException("フィルターの作成中に不明なエラーが発生しました: " + ex.Message, ex);
			}
		}
Esempio n. 24
0
 public UserCommands(TwitterAccount objAccount)
     : base(objAccount)
 {
 }
Esempio n. 25
0
        public virtual void Initialize(TwitterAccount account, SettingData setting, Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
        {
            this.account = account;
            this.account.UserStreamClient.GetStreamHome += this.GetStreamTweet;
            this.account.UserStreamClient.GetStreamFavorited += this.GetStreamFavorited;
            this.account.UserStreamClient.GetStreamIsFavorited += this.GetStreamIsFavorited;
            this.account.UserStreamClient.GetStreamSystemMessage += this.GetStreamSystemMessage;
            this.account.UserStreamClient.GetStreamDelete += this.GetStreamDelete;
            this.account.UserStreamClient.GetStreamDirectMessage += GetStreamDirectMessage;
            this.account.UserStreamClient.GetStreamFollow+=GetStreamFollow;
            this.account.UserStreamClient.GetStreamIsFollowed += GetStreamIsFollow;
            this.account.FollowStreamClient.GetStreamRetweet += GetStreamRetweet;
            this.account.FollowStreamClient.GetStreamRetweeted += GetStreamRetweeted;
            this.account.FollowStreamClient.GetStreamMe += GetStreamMe;
            this.account.FollowStreamClient.GetStreamMention += GetStreamMention;
            this.account.FollowStreamClient.GetStreamDelete += GetStreamDelete;
            this.account.OnTweetFailed += OnTweetFailed;
            this.account.OnUserStreamHttpError += OnUserStreamHttpError;
            this.account.ChangeUserStreamEvent += ChangeUserStreamEvent;
            this.timelineWidth = 320;
            this.RowMax = 2000;
            this.timelineActionCallback = timelineActionCallback;
            this.rowActionCallback = rowActionCallback;
            this.Setting = setting;
            
           


            EditCommand = new DelegateCommand(() =>
            {
                this.timelineActionCallback(new TimelineAction(TimelineActionType.Edit, this));
            });
            DeleteCommand = new DelegateCommand(() =>
            {
                this.timelineActionCallback(new TimelineAction(TimelineActionType.Delete, this));
            });

            foreach (var t in TimeLine)
            {
                t.InitializeBase(rowActionCallback);
                if (t is TimelineRow)
                {
                    (t as TimelineRow).Initialize(rowActionCallback);
                }
                else if (t is DirectMessageRow)
                {
                    (t as DirectMessageRow).Initialize(rowActionCallback);
                }
                else if (t is NotificationRow)
                {
                    (t as NotificationRow).Initialize(rowActionCallback);
                }
            }


        }
Esempio n. 26
0
        public TimelineBase(TwitterAccount account, string listTitle, string tabName, TimelineType type, SettingData setting, Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
        {

            this.ListTitle = listTitle;
            timeLine = new ObservableCollection<RowBase>();
            IsTimelineFiltering = false;
            IsNewNotification = false;
            this.TimelineType = type;
            this.TabName = tabName;
            ExtractionAccountScreenNameStr = string.Empty;
            ExcludeAccountScreenNameStr = string.Empty;
            ExtractionWordStr = string.Empty;
            ExcludeWordStr = string.Empty;
            this.Setting = setting;
            IsNowLoading = false;
            liveTileCounter = 0;

        }
Esempio n. 27
0
        public void getUserProile(oAuthTwitter OAuth, string TwitterScreenName, Guid userId)
        {
            try
            {
                Users                    userinfo       = new Users();
                TwitterAccount           twitterAccount = new TwitterAccount();
                TwitterAccountRepository twtrepo        = new TwitterAccountRepository();
                JArray                   profile        = userinfo.Get_Users_LookUp(OAuth, TwitterScreenName);
                foreach (var item in profile)
                {
                    try
                    {
                        twitterAccount.FollowingCount = Convert.ToInt32(item["friends_count"].ToString());
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        twitterAccount.FollowersCount = Convert.ToInt32(item["followers_count"].ToString());
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    twitterAccount.IsActive    = true;
                    twitterAccount.OAuthSecret = OAuth.AccessTokenSecret;
                    twitterAccount.OAuthToken  = OAuth.AccessToken;
                    try
                    {
                        twitterAccount.ProfileImageUrl = item["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        twitterAccount.ProfileUrl = string.Empty;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        twitterAccount.TwitterUserId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception er)
                    {
                        try
                        {
                            twitterAccount.TwitterUserId = item["id"].ToString().TrimStart('"').TrimEnd('"');
                        }
                        catch (Exception err)
                        {
                            Console.WriteLine(err.StackTrace);
                        }
                        Console.WriteLine(er.StackTrace);
                    }
                    try
                    {
                        twitterAccount.TwitterScreenName = item["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    twitterAccount.UserId = userId;

                    if (twtrepo.checkTwitterUserExists(twitterAccount.TwitterUserId, userId))
                    {
                        twtrepo.updateTwitterUser(twitterAccount);
                    }
                    getTwitterStats(twitterAccount);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
Esempio n. 28
0
 public override Task <TwitterStatus> Send(TwitterAccount account)
 {
     return(account.SendDirectMessageAsync(_id, _text));
 }
Esempio n. 29
0
 public ListTimeline(TwitterAccount account, string listTitle, string tabName, TwitterList list, SettingData setting, Action <TimelineAction> timelineActionCallback, Action <RowAction> rowActionCallback)
     : base(account, listTitle, tabName, TimelineType.List, setting, timelineActionCallback, rowActionCallback)
 {
     this.TwitterList = list;
     Initialize(account, setting, timelineActionCallback, rowActionCallback);
 }
Esempio n. 30
0
 public UserStreamsDisconnectedEvent(TwitterAccount account, string reason)
 {
     _account = account;
     _reason  = reason;
 }
 protected override async Task <ICursorResult <IEnumerable <long> > > GetUsersApiImpl(TwitterAccount info, long id,
                                                                                      long cursor)
 {
     return((await info.CreateAccessor()
             .GetFollowersIdsAsync(new UserParameter(id), cursor, null, CancellationToken.None))
            .Result);
 }
Esempio n. 32
0
 public ListReceiver(TwitterAccount auth, ListInfo listInfo)
 {
     this._auth     = auth;
     this._listInfo = listInfo;
 }
Esempio n. 33
0
 public PostLimitedEvent(TwitterAccount account, DateTime releaseTime)
 {
     _account     = account;
     _releaseTime = releaseTime;
 }
Esempio n. 34
0
 public static TwitterSnapshot GetTwitterSnapshot(TwitterAccount twitterAccount)
 {
     return (new TwitterQuery()).GetSnapshot(twitterAccount) as TwitterSnapshot;
 }
        private async void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            bool isInputOK = true;

            if (textTimelineName.Text == string.Empty)
            {
                MessageDialog dialog = new MessageDialog("タイムライン名が入力されていません", "入力エラー");
                await dialog.ShowAsync();

                isInputOK = false;
            }
            foreach (var t in viewModel.NowTimelineList)
            {
                if (t.ListTitle == textTimelineName.Text)
                {
                    MessageDialog dialog = new MessageDialog("タイムライン名が競合しています。固有のタイムライン名を入力してください", "入力エラー");
                    await dialog.ShowAsync();

                    isInputOK = false;
                }
            }
            if (this.comboBoxAccount.SelectedIndex == -1)
            {
                MessageDialog dialog = new MessageDialog("アカウント名が選択されていません", "入力エラー");
                await dialog.ShowAsync();

                isInputOK = false;
            }
            if (this.comboBoxTimelineType.SelectedIndex == -1)
            {
                MessageDialog dialog = new MessageDialog("タイムラインタイプが選択されていません", "入力エラー");
                await dialog.ShowAsync();

                isInputOK = false;
            }

            if (isInputOK == true)
            {
                TimelineBase   resultModel = null;
                TwitterAccount account     = (TwitterAccount)comboBoxAccount.SelectedItem;
                switch (comboBoxTimelineType.SelectedIndex)
                {
                case 0:
                    resultModel = new HomeTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);
                    break;

                case 1:
                    resultModel = new MentionTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);

                    break;

                case 2:
                    resultModel = new NotificationTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);

                    break;

                case 3:
                    if (textSearchWord.Text == string.Empty)
                    {
                        MessageDialog dialog = new MessageDialog("検索ワードが入力されていません", "入力エラー");
                        await dialog.ShowAsync();

                        return;
                    }
                    resultModel = new SearchTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, textSearchWord.Text, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);

                    break;

                case 4:
                    if (comboList.SelectedIndex == -1)
                    {
                        MessageDialog dialog = new MessageDialog("リストが選択されていません", "入力エラー");
                        await dialog.ShowAsync();

                        return;
                    }
                    resultModel = new ListTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, (TwitterList)comboList.SelectedItem, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);

                    break;

                case 5:
                    resultModel = new DirectMessageTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);
                    break;

                case 6:
                    if (textUser.Text == string.Empty)
                    {
                        MessageDialog dialog = new MessageDialog("ユーザー名が入力されていません", "入力エラー");
                        await dialog.ShowAsync();

                        return;
                    }
                    resultModel = new UserTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, textUser.Text, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);

                    break;

                case 7:
                    resultModel = new ImageTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);
                    break;

                case 8:
                    resultModel = new LinkTimeline(account, textTimelineName.Text, viewModel.GetNowTab().TabTitle, viewModel.Setting, viewModel.CallTimelineAction, viewModel.CallRowAction);

                    break;
                }
                if (toggleTimelineFiltering.IsOn)
                {
                    resultModel.ExtractionAccountScreenNameStr = textExtractionAccount.Text;
                    resultModel.ExcludeAccountScreenNameStr    = textExcludeAccount.Text;
                    resultModel.ExtractionWordStr   = textExtractionWord.Text;
                    resultModel.ExcludeWordStr      = textExcludeWord.Text;
                    resultModel.IsTimelineFiltering = toggleTimelineFiltering.IsOn;
                    resultModel.IsNewNotification   = toggleNotification.IsOn;
                }

                viewModel.AddTimelineCommand.Execute(resultModel);
                onCreateCallBack(resultModel);
                this.Hide();
            }
        }
        public ActionResult EditProfileDetails(string ProfileId, string UserId, string Network)
        {
            if (Session["User"] != null)
            {
                Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"];
                if (_User.UserType != "SuperAdmin")
                {
                    return(RedirectToAction("Index", "Index"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Index"));
            }
            Dictionary <string, object> objProfileToEdit = new Dictionary <string, object>();

            if (Network == "Facebook")
            {
                Api.FacebookAccount.FacebookAccount Apiobjfb = new Api.FacebookAccount.FacebookAccount();
                FacebookAccount objFbAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(Apiobjfb.getFacebookAccountDetailsById(UserId, ProfileId), typeof(FacebookAccount)));
                Session["UpdateProfileData"] = objFbAccount;
                objProfileToEdit.Add("Facebook", objFbAccount);
            }
            if (Network == "Twitter")
            {
                Api.TwitterAccount.TwitterAccount Apiobjtwt = new Api.TwitterAccount.TwitterAccount();
                TwitterAccount objtwtAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(Apiobjtwt.GetTwitterAccountDetailsById(UserId, ProfileId), typeof(TwitterAccount)));
                Session["UpdateProfileData"] = objtwtAccount;
                objProfileToEdit.Add("Twitter", objtwtAccount);
            }
            if (Network == "Linkedin")
            {
                Api.LinkedinAccount.LinkedinAccount Apiobjlin = new Api.LinkedinAccount.LinkedinAccount();
                LinkedInAccount objLinAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(Apiobjlin.GetLinkedinAccountDetailsById(UserId, ProfileId), typeof(LinkedInAccount)));
                Session["UpdateProfileData"] = objLinAccount;
                objProfileToEdit.Add("Linkedin", objLinAccount);
            }
            if (Network == "Instagram")
            {
                Api.InstagramAccount.InstagramAccount ApiobjIns = new Api.InstagramAccount.InstagramAccount();
                InstagramAccount objInsAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjIns.UserInformation(UserId, ProfileId), typeof(InstagramAccount)));
                Session["UpdateProfileData"] = objInsAccount;
                objProfileToEdit.Add("Instagram", objInsAccount);
            }
            if (Network == "Tumblr")
            {
                Api.TumblrAccount.TumblrAccount Apiobjtmb = new Api.TumblrAccount.TumblrAccount();
                TumblrAccount objTmbAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(Apiobjtmb.GetTumblrAccountDetailsById(UserId, ProfileId), typeof(TumblrAccount)));
                Session["UpdateProfileData"] = objTmbAccount;
                objProfileToEdit.Add("Tumblr", objTmbAccount);
            }
            if (Network == "Youtube")
            {
                Api.YoutubeAccount.YoutubeAccount ApiobjYoutb = new Api.YoutubeAccount.YoutubeAccount();
                YoutubeAccount objYouTbAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutb.GetYoutubeAccountDetailsById(UserId, ProfileId), typeof(YoutubeAccount)));
                Session["UpdateProfileData"] = objYouTbAccount;
                objProfileToEdit.Add("Youtube", objYouTbAccount);
            }
            if (Network == "GooglePlus")
            {
                Api.GooglePlusAccount.GooglePlusAccount Apiobjgplus = new Api.GooglePlusAccount.GooglePlusAccount();
                GooglePlusAccount objGPAccount = (GooglePlusAccount)(new JavaScriptSerializer().Deserialize(Apiobjgplus.GetGooglePlusAccountDetailsById(UserId, ProfileId), typeof(GooglePlusAccount)));
                Session["UpdateProfileData"] = objGPAccount;
                objProfileToEdit.Add("GooglePlus", objGPAccount);
            }

            return(View(objProfileToEdit));
        }
Esempio n. 37
0
 public Task Add(TwitterAccount twitterAccount)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 38
0
 public BaseCommands(TwitterAccount objAccount)
 {
     Account = objAccount;
     Parameters = new ParameterDataCollection();
 }
Esempio n. 39
0
 public TrendCommands(TwitterAccount objAccount)
     : base(objAccount)
 {
 }
Esempio n. 40
0
        public static Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, Dictionary <object, List <object> > > GetUserProfilesSnapsAccordingToGroup(List <Domain.Socioboard.Domain.TeamMemberProfile> TeamMemberProfile)
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, Dictionary <object, List <object> > > dic_profilessnap = new Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, Dictionary <object, List <object> > >();
            var dicprofilefeeds = new Dictionary <object, List <object> >();

            foreach (Domain.Socioboard.Domain.TeamMemberProfile item in TeamMemberProfile)
            {
                List <object> feeds = null;
                if (item.ProfileType == "facebook")
                {
                    feeds = new List <object>();
                    Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                    FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount)));
                    Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
                    List <FacebookFeed>           lstFacebookFeed    = (List <FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <FacebookFeed>)));
                    foreach (var facebookfeed in lstFacebookFeed)
                    {
                        feeds.Add(facebookfeed);
                    }
                    dicprofilefeeds.Add(objFacebookAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "twitter")
                {
                    feeds = new List <object>();
                    Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                    TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount)));
                    Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
                    List <TwitterFeed>          lstTwitterFeed    = (List <TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <TwitterFeed>)));
                    foreach (var twitterfeed in lstTwitterFeed)
                    {
                        feeds.Add(twitterfeed);
                    }
                    dicprofilefeeds.Add(objTwitterAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "linkedin")
                {
                    feeds = new List <object>();
                    Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                    LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount)));
                    Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed();
                    List <LinkedInFeed>           lstLinkedInFeed    = (List <LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <LinkedInFeed>)));
                    foreach (var LinkedInFeed in lstLinkedInFeed)
                    {
                        feeds.Add(LinkedInFeed);
                    }
                    dicprofilefeeds.Add(objLinkedInAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }
                if (item.ProfileType == "instagram")
                {
                    feeds = new List <object>();
                    Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                    InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount)));
                    dicprofilefeeds.Add(objInstagramAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "tumblr")
                {
                    feeds = new List <object>();
                    Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                    TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount)));
                    dicprofilefeeds.Add(objTumblrAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }


                if (item.ProfileType == "youtube")
                {
                    feeds = new List <object>();
                    Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                    YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount)));
                    Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel();
                    YoutubeChannel        objYoutubeChannel = (YoutubeChannel)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeChannel)));
                    List <YoutubeChannel> lstYoutubeChannel = new List <YoutubeChannel>();
                    lstYoutubeChannel.Add(objYoutubeChannel);
                    foreach (var youtubechannel in lstYoutubeChannel)
                    {
                        feeds.Add(youtubechannel);
                    }
                    dicprofilefeeds.Add(objYoutubeAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }
            }
            return(dic_profilessnap);
        }
Esempio n. 41
0
 public TwitterTimeline(TwitterAccount account)
     : base(account)
 {
     this._account = account;
 }
Esempio n. 42
0
 protected abstract Task <ICursorResult <IEnumerable <long> > > GetUsersApiImpl(TwitterAccount info, long id, long cursor);
Esempio n. 43
0
 public DirectMessageTimeline(TwitterAccount account, string listTitle, string tabName,SettingData setting, Action<TimelineAction> timelineActionCallback, Action<RowAction> rowActionCallback)
     : base(account, listTitle, tabName, TimelineType.DirectMessage,setting, timelineActionCallback, rowActionCallback)
 {
     Initialize(account,setting, timelineActionCallback, rowActionCallback);
 }
Esempio n. 44
0
 public string ProfilesConnected(string UserId)
 {
     try
     {
         Guid userid = Guid.Parse(UserId);
         SocialProfilesRepository socialRepo      = new SocialProfilesRepository();
         List <SocialProfile>     lstsocioprofile = socialRepo.getAllSocialProfilesOfUser(userid);
         List <profileConnected>  lstProfile      = new List <profileConnected>();
         foreach (SocialProfile sp in lstsocioprofile)
         {
             profileConnected pc = new profileConnected();
             pc.Id            = sp.Id;
             pc.ProfileDate   = sp.ProfileDate;
             pc.ProfileId     = sp.ProfileId;
             pc.ProfileStatus = sp.ProfileStatus;
             pc.ProfileType   = sp.ProfileType;
             pc.UserId        = sp.UserId;
             if (sp.ProfileType == "facebook")
             {
                 try
                 {
                     FacebookAccountRepository objFbAccRepo = new FacebookAccountRepository();
                     FacebookAccount           objFbAcc     = objFbAccRepo.getUserDetails(sp.ProfileId);
                     pc.ProfileName   = objFbAcc.FbUserName;
                     pc.ProfileImgUrl = "http://graph.facebook.com/" + sp.ProfileId + "/picture?type=small";
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "twitter")
             {
                 try
                 {
                     TwitterAccountRepository objTwtAccRepo = new TwitterAccountRepository();
                     TwitterAccount           objTwtAcc     = objTwtAccRepo.getUserInfo(sp.ProfileId);
                     pc.ProfileName   = objTwtAcc.TwitterScreenName;
                     pc.ProfileImgUrl = objTwtAcc.ProfileImageUrl;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "instagram")
             {
                 try
                 {
                     InstagramAccountRepository objInsAccRepo = new InstagramAccountRepository();
                     InstagramAccount           objInsAcc     = objInsAccRepo.getInstagramAccountById(sp.ProfileId);
                     pc.ProfileName   = objInsAcc.InsUserName;
                     pc.ProfileImgUrl = objInsAcc.ProfileUrl;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "linkedin")
             {
                 try
                 {
                     LinkedInAccountRepository objLiAccRepo = new LinkedInAccountRepository();
                     LinkedInAccount           objLiAcc     = objLiAccRepo.getLinkedinAccountDetailsById(sp.ProfileId);
                     pc.ProfileName   = objLiAcc.LinkedinUserName;
                     pc.ProfileImgUrl = objLiAcc.ProfileImageUrl;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "googleplus")
             {
                 try
                 {
                     GooglePlusAccountRepository objGpAccRepo = new GooglePlusAccountRepository();
                     GooglePlusAccount           objGpAcc     = objGpAccRepo.getUserDetails(sp.ProfileId);
                     pc.ProfileName   = objGpAcc.GpUserName;
                     pc.ProfileImgUrl = objGpAcc.GpProfileImage;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             lstProfile.Add(pc);
         }
         return(new JavaScriptSerializer().Serialize(lstProfile));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(new JavaScriptSerializer().Serialize("Please Try Again"));
     }
 }
Esempio n. 45
0
 public static void RegisterListMember(TwitterAccount authInfo, ListInfo info)
 {
     _listMemberReceiveManager.StartReceive(authInfo, info);
 }
Esempio n. 46
0
 public UserRelationReceiver(TwitterAccount account)
 {
     this._account = account;
 }
Esempio n. 47
0
 public ImageTimeline(TwitterAccount account, string listTitle, string tabName, SettingData setting, Action <TimelineAction> timelineActionCallback, Action <RowAction> rowActionCallback)
     : base(account, listTitle, tabName, TimelineType.Home, setting, timelineActionCallback, rowActionCallback)
 {
     Initialize(account, setting, timelineActionCallback, rowActionCallback);
 }
Esempio n. 48
0
 public ListMemberReceiver(TwitterAccount auth, ListInfo listInfo)
 {
     _auth     = auth;
     _listInfo = listInfo;
 }
Esempio n. 49
0
 public UserStreamsReceiver(TwitterAccount account)
 {
     this._stateUpdater = new StateUpdater();
     this._account      = account;
 }
Esempio n. 50
0
		internal MultiReply(TwitterAccount sender)
		{
			this.Sender = sender;
			this.Destinations = Enumerable.Empty<User>();
		}
Esempio n. 51
0
 public TwitterAccountViewModel(TwitterAccount account)
 {
     this._account = account;
 }
		private static Expression<Func<Status, bool>> GetFilterExpression(string query, TwitterAccount account)
		{
			query = query.Trim();

			var matches = keyValueRegex.Matches(query);
			if (matches.Count == 1)
			{
				var key = matches[0].Groups["key"].ToString();
				var value = matches[0].Groups["value"].ToString();
				var op = matches[0].Groups["operator"].ToString();

				var dust = query.Replace(matches[0].Groups[0].ToString(), "");
				if (!string.IsNullOrWhiteSpace(dust))
				{
					throw new FilterException("クエリ '" + key + "' に、認識できない文字 '" + dust + "' が含まれています。");
				}

				if (key == "text")
				{
					var q = new PartialMatch(key, value, op.ToFilterMode());
					return status => q.Match(status.Text, true);
				}
				if (key == "user")
				{
					var q = new ScreenNameQuery(key, new ScreenName(value).Value, op.ToFilterMode());
					return status => q.Match(status.User.ScreenName);
				}
				if (key == "via")
				{
					var q = new FullMatch(key, value, op.ToFilterMode());
					return status => q.Match(status.DisplayStatus.Source.Client, true);
				}
				if (key == "retweeted")
				{
					var q = new BooleanQuery(key, value, op.ToFilterMode());
					return status => q.Match(status.IsRetweetStatus);
				}
				if (key == "mention")
				{
					var q = new MentionQuery(key, value, op.ToFilterMode());
					return status => q.Match(status);
				}

				throw new FilterException("クエリ '" + query + "' は認識できません。");
			}

			if (matches.Count > 1)
			{
				var keys = matches.OfType<Match>()
					.Select(m => m.Groups["key"].ToString())
					.Select(m => "'" + m + "'")
					.ToString(", ");
				throw new FilterException("複数のキー (" + keys + ") を検出しましたが、それらの論理演算子が不明です。");
			}

			throw new FilterException("クエリは key=\"value\" の形式で指定してください。");
		}
Esempio n. 53
0
 public TrackLimitEvent(TwitterAccount relatedInfo, int drop)
 {
     this._info = relatedInfo;
     this._drop = drop;
 }
Esempio n. 54
0
 private void Initialize()
 {
     _twitterAccountInformation = _twitterPersistenceService.Load();
     _twitterService = new TwitterService(Constants.ConsumerKey,
         Constants.ConsumerSecret);
     _twitterService.AuthenticateWith(_twitterAccountInformation.AccessToken,
         _twitterAccountInformation.AccessTokenSecret);
     _twitterAccount = _twitterService.GetAccountSettings();
 }
Esempio n. 55
0
 private Task <TwitterList> ReceiveListDescription(TwitterAccount account, ListInfo info)
 {
     return(account.ShowListAsync(info.OwnerScreenName, info.Slug));
 }
Esempio n. 56
0
		internal Normal(TwitterAccount sender)
		{
			this.Sender = sender;
		}
Esempio n. 57
0
 internal static void NotifyLimitationInfoGot(TwitterAccount account, int trackLimit)
 {
     Head.NotifyLimitationInfoGot(account, trackLimit);
 }
Esempio n. 58
0
		internal Reply(TwitterAccount sender, Status inReplyTo)
		{
			this.Sender = sender;
			this.InReplyTo = inReplyTo;
		}
Esempio n. 59
0
 /// <summary>
 /// Send request.
 /// </summary>
 /// <returns></returns>
 public abstract Task <T> Send(TwitterAccount account);
Esempio n. 60
0
        private static List<TwitterAccount> GetAccountsFromDB()
        {
            List<TwitterAccount> twitterAccounts = new List<TwitterAccount>();
            var dbAccounts = DataAccess.GetTwitterAccounts();

            foreach(TwitterAccounts dbAccount in dbAccounts)
            {
                TwitterAccount twitterAccount = new TwitterAccount(dbAccount.AccountName, dbAccount.AccessToken, dbAccount.VerificationString);
                twitterAccounts.Add(twitterAccount);
            }

            return twitterAccounts;
        }