private void LoadInstaAccountsFromDB() { var instagramAccountsList = SQLiteDatabaseAccess.GetInstagramAccount(SQLiteDatabaseAccess.GetLoggedUser().Id); foreach (var acc in instagramAccountsList) { ListViewItem lvi = new ListViewItem(acc.EmailPhone); listOfInstagramAccounts.Items.Add(lvi); } }
public void AddFollowedPerson() { var user = SQLiteDatabaseAccess.GetUser("morti", "mati"); var instagramAccount = SQLiteDatabaseAccess.GetInstagramAccount("0765835785"); FollowedPerson followedPerson = new FollowedPerson() { FollowedPersonLinkString = instagramAccount.FollowedPersonLinkString, FollowDate = DateTime.Now, UserURL = "https://www.instagram.com/cacat.la_punga/" }; SQLiteDatabaseAccess.AddFollowedPerson(followedPerson); }
private void UseSelectedAccount_Click(object sender, EventArgs e) { if (listOfInstagramAccounts.SelectedItems.Count == 1) { var selectedAccountEmailPhone = SQLiteDatabaseAccess.GetInstagramAccount(listOfInstagramAccounts.SelectedItems[0].Text); if (selectedAccountEmailPhone != null) { InstaToolFeatures itf = new InstaToolFeatures(selectedAccountEmailPhone); itf.Show(); this.Hide(); } } else { MessageBox.Show("Please select an account from the list", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); } }
public Home PerformLogin(string emailOrPhone) { InstagramAccount instaAccount = null; try { instaAccount = SQLiteDatabaseAccess.GetInstagramAccount(emailOrPhone); LoggedAccount = emailOrPhone; } catch (Exception ex) { } if (instaAccount != null) { try { IWebElement cookiesAccept = DriverExtensions.FindElement(InstaDriver, By.XPath("//*[contains(@class,'aOOlW bIiDR ')]"), 20); cookiesAccept.Click(); IWebElement loginEmail = InstaDriver.FindElementByXPath("//*[contains(@aria-label,'Phone number, username, or email')]"); loginEmail.SendKeys(emailOrPhone); IWebElement loginPassword = InstaDriver.FindElementByXPath("//*[contains(@aria-label,'Password')]"); loginPassword.SendKeys(instaAccount.Password); IWebElement loginButton = InstaDriver.FindElementByXPath("//*[contains(@type,'submit')]"); loginButton.Click(); if (CheckIsLoggedIn()) { PassLoginPopUps(); LogHelper.Log("Succesfully logged in"); return(new Home(InstaDriver)); } } catch (Exception ex) { LogHelper.Log($"Some error occured trying to login..., {ex.GetType()}"); } } return(null); }