public void GetUserInfo() { string baseUrl = "https://api.instagram.com/v1/users/self"; Dictionary <string, string> parameters = new Dictionary <string, string> (); parameters.Add("access_token", AccessToken); WebRequest.Get(UrlEncode(baseUrl, parameters), (res) => { if (res.isDone) { InstagramUser user = new InstagramUser(res.text); WebRequest.GetTexture(user.PictureUrl, (res2) => { if (res2.isDone) { user.Picture = ((DownloadHandlerTexture)res2).texture; } else { //well, profile picture wasn't downloaded. no biggy. } Action <User> OnUserInfoHandler = OnUserInfo; if (OnUserInfoHandler != null) { OnUserInfoHandler(user); } }); } else { //something went wrong here. } }); }
async void OnListViewItemTapped(object sender, ItemTappedEventArgs e) { InstagramUser tappedItem = e.Item as InstagramUser; bool answer = await DisplayAlert("Warning", "Do you want to unfollow " + tappedItem.Username + "?", "Yes", "No"); if (answer == true) { var response = await InstaApi.UserProcessor.UnFollowUserAsync(tappedItem.UserId); if (response.Succeeded) { await DisplayAlert("Info", "Unfollowed " + tappedItem.Username, "Ok"); //Refresh list not_following_back.Remove(tappedItem); Updated = true; } else { await DisplayAlert("Error", response.Info.Message, "Ok"); } } //listView.SelectedItem = null; }
public void Start_Change_password(String NewPassword, ref InstagramUser obj_GDuser) { try { string url = "https://www.instagram.com/accounts/password/change/"; string edit_password = obj_GDuser.globusHttpHelper.getHtmlfromUrl(new Uri("https://www.instagram.com"), "https://www.instagram.com", ""); string edit_password2 = obj_GDuser.globusHttpHelper.getHtmlfromUrl(new Uri(url), "https://www.instagram.com/accounts/edit/", ""); string crstoken = Utils.getBetween(edit_password2, "csrf_token", "\"}").Replace("\":\"", string.Empty); string postdata = "old_password="******"&new_password1=" + NewPassword + "&new_password2=" + NewPassword + "&csrfmiddlewaretoken=" + crstoken; string resp = obj_GDuser.globusHttpHelper.PostDataWithInstagram(new Uri("https://www.instagram.com/accounts/password/change/"), postdata, "https://www.instagram.com/accounts/edit/"); string responce_result = obj_GDuser.globusHttpHelper.getHtmlfromUrl(new Uri("https://www.instagram.com/accounts/password/change/done/"), "", "https://www.instagram.com/accounts/password/change/"); if (responce_result.Contains("Thanks! You have successfully changed your password.")) { GlobusLogHelper.log.Info("Password Successfully change of Account ===> " + obj_GDuser.username); DataBaseHandler.InsertQuery("insert into tbl_AccountReport(ModuleName,Account_User,Status) values('" + "Manage Account" + "','" + obj_GDuser.username + "','" + "Password Changed" + "')", "tbl_AccountReport"); GlobusLogHelper.log.Info("Password Successfully change of Account ===> " + obj_GDuser.username + " newpassword=====>" + NewPassword); ClGlobul.ListPassword.Remove(NewPassword); // break; } else { GlobusLogHelper.log.Info("Password Not Change Of Account ====>" + obj_GDuser.username); ClGlobul.ListPassword.Remove(NewPassword); //break; } } catch (Exception ex) { GlobusLogHelper.log.Error("Error :" + ex.StackTrace); } }
private async void dont_follow_you_button_Clicked(object sender, EventArgs e) { var not_followin_back_page_instance = new NotFollowingMePage(); not_followin_back_page_instance.InstaApi = InstaApi; not_followin_back_page_instance.CurrentUserObject = CurrentUserObject; ObservableCollection <InstagramUser> usernames = new ObservableCollection <InstagramUser>(); foreach (var u in not_following_back) { var added_user = new InstagramUser { FullName = u.FullName, Username = u.UserName, ImageUrl = u.ProfilePicUrl, UserId = u.Pk }; usernames.Add(added_user); } not_followin_back_page_instance.not_following_back = usernames; await Navigation.PushAsync(not_followin_back_page_instance); }
private object[] CreateParams(InstagramUser instagramUser, Venue venue) { return(new object[] { "@Instagram_Id", instagramUser.Id, "@Venue_Id", venue.Id }); }
private object[] CreateParams(InstagramUser entity) { return(new object[] { "@Id", entity.Id, "@Username", entity.Username, "@Instagram_Id", entity.InstagramId }); }
public string TestResult() { InstagramUser user = new InstagramUser(); user.username = "******"; user.first_name = "Chris"; user.last_name = "Jones"; return(user.Serialize()); }
private void StartActionDirectMessage(ref InstagramUser fbUser) { try { Start_Send(ref fbUser); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
public async Task <IHttpActionResult> LoginInstagram(InstagramUser profile) { try { var user = await db.Users.Where(u => u.Email == profile.Id).FirstOrDefaultAsync(); if (user == null) { user = new User { Email = profile.Id, FirstName = profile.FullName, LastName = ".", ImagePath = profile.ProfilePicture, UserTypeId = 3, Telephone = "...", }; db.Users.Add(user); UsersHelper.CreateUserASP(profile.Id, "User", profile.Id); } else { user.FirstName = profile.FullName; user.LastName = "."; user.ImagePath = profile.ProfilePicture; db.Entry(user).State = EntityState.Modified; } await db.SaveChangesAsync(); return(Ok(true)); } catch (DbEntityValidationException e) { var message = string.Empty; foreach (var eve in e.EntityValidationErrors) { message = string.Format("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { message += string.Format("\n- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } return(BadRequest(message)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
private async void menu_list_ItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e) { AppFeature tappedItem = e.ItemData as AppFeature; switch (tappedItem.Title) { case "Users not following you back": var not_followin_back_page_instance = new NotFollowingMePage(); not_followin_back_page_instance.InstaApi = InstaApi; not_followin_back_page_instance.CurrentUserObject = CurrentUserObject; ObservableCollection <InstagramUser> usernames = new ObservableCollection <InstagramUser>(); foreach (var u in not_following_back) { var added_user = new InstagramUser { FullName = u.FullName, Username = u.UserName, ImageUrl = u.ProfilePicUrl, UserId = u.Pk }; usernames.Add(added_user); } not_followin_back_page_instance.not_following_back = usernames; await Navigation.PushAsync(not_followin_back_page_instance); break; case "Users you don't follow back": var you_dont_follow_page_instance = new YouDontFollowPage(); you_dont_follow_page_instance.InstaApi = InstaApi; var usernames1 = new List <InstagramUser>(); foreach (var u in i_dont_follow_back) { var added_user = new InstagramUser { FullName = u.FullName, Username = u.UserName, ImageUrl = u.ProfilePicUrl }; usernames1.Add(added_user); } you_dont_follow_page_instance.i_dont_follow_back = usernames1; await Navigation.PushAsync(you_dont_follow_page_instance); break; } }
public InstagramPost(string json) { JObject jObject = JObject.Parse(json); JToken jInstaPost = jObject["data"]; id = (string)jInstaPost["id"]; created_time = (string)jInstaPost["created_time"]; user = new InstagramUser(jInstaPost["user"]); images = new InstagramImages(jInstaPost["images"]); caption = new InstagramCaption(jInstaPost["caption"]); likes = new InstagramLikes(jInstaPost["likes"]); link = (string)jInstaPost["link"]; }
public static async Task <IInstaApi> GetInstaApiAsync(InstagramUser user) { var test = user.GetHashCode(); IInstaApi instaApi = apiCollection.GetValueOrDefault(user, null); if (instaApi == null) { instaApi = await TryToLoginAsync(user); apiCollection.Add(user, instaApi); } return(instaApi); }
private void LoginWithMobileDevice(ref InstagramUser objInstagramUser) { try { string guid = string.Empty; string deviceId = string.Empty; guid = GenerateGuid(); if (!string.IsNullOrEmpty(guid)) { objInstagramUser.guid = guid; } deviceId = "android-" + guid; if (!string.IsNullOrEmpty(deviceId)) { objInstagramUser.deviceid = deviceId; } string Data = "{\"device_id\":\"" + deviceId + "\",\"guid\":\"" + guid + "\",\"username\":\"" + objInstagramUser.username + "\",\"password\":\"" + objInstagramUser.password + "\",\"Content-Type\":\"application/x-www-form-urlencoded; charset=UTF-8\"}"; Data = "{\"device_id\":\"" + deviceId + "\",\"guid\":\"" + guid + "\",\"username\":\"" + objInstagramUser.username + "\",\"password\":\"" + objInstagramUser.password + "\",\"Content-Type\":\"application/x-www-form-urlencoded; charset=UTF-8\"}"; string Sig = GenerateSignature(Data); string Data_HttpUtility = HttpUtility.UrlEncode(Data); string postDataLoginMobile = "signed_body=" + Sig + "." + Data_HttpUtility + "&ig_sig_key_version=6"; string postUrlLogin = "******"; string loginResponse = objInstagramUser.globusHttpHelper.postFormDataFromProxyMobileLogin(new Uri(postUrlLogin), postDataLoginMobile, objInstagramUser.proxyip, int.Parse(objInstagramUser.proxyport), objInstagramUser.proxyusername, objInstagramUser.proxypassword); GlobusHttpHelper objGlobusshttpHelper = new GlobusHttpHelper(); // string resp = objGlobusshttpHelper.postFormDataMobileLogin(new Uri(postUrlLogin), postDataLoginMobile); if (loginResponse.Contains(objInstagramUser.username.ToLower()) && !loginResponse.Contains("lt-ie7 not-logged-in"))//marieturnipseed55614 { GlobusLogHelper.log.Info("[ Logged in with Account Success :" + objInstagramUser.username + " ]"); objInstagramUser.isloggedin = true; objInstagramUser.LogInStatus = "Success"; } else { objInstagramUser.LogInStatus = "Fail"; GlobusLogHelper.log.Info("[ Logged in with Account Fail : " + objInstagramUser.username + " ]"); } } catch (Exception ex) { GlobusLogHelper.log.Error("Error ==> " + ex.Message); } }
private void StartActionCommentPoster(ref InstagramUser fbUser) { try { Start_Comment(ref fbUser); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } finally { GlobusLogHelper.log.Info("============================"); GlobusLogHelper.log.Info("Process Completed"); GlobusLogHelper.log.Info("============================"); } }
public async Task <string> ExecuteTestCode() { StringBuilder message = new StringBuilder(); // Shows an example how you get information of the current user await CreateNewGraphDb(); string jsonResponse = await InstagramAPI.GetUserSelf(); InstagramUser userSelf = InstagramUser.CreateFromJsonResponse(jsonResponse); await CreateGraphUser(userSelf); var myLikes = await GetMediaSelfLiked(); var mediaTaggedItems = await GetTaggedMedia("beer"); Debug.WriteLine("Have Found : {0} tagged Items", mediaTaggedItems.Data.Count); foreach (var item in mediaTaggedItems.Data) { Debug.WriteLine("Created By {0} : Has {1} likes : Has {2} comments", item.User.Full_name, item.Likes.Count, item.Comments.Count); await CreateGraphMediaItem(item, userSelf.Data.Id); await CreateLikeGraphEdge(userSelf.Data.Id, item.Id); if (userSelf.Data.Id == item.User.Id) { Debug.WriteLine("This is Me!"); } else { await CreateGraphUser(item.User.Id, item.User.Full_name, -1, -1); } if (item.User_has_liked) { Debug.WriteLine("Have already liked this"); } else { Debug.WriteLine("Potential item to like"); } } return(message.ToString()); }
public static async Task <InstagramUser> ScrapeInstagram(string url) { using (var client = new HttpClient()) { var response = await client.GetAsync(url); if (response.IsSuccessStatusCode) { // create html document var htmlBody = await response.Content.ReadAsStringAsync(); //Console.WriteLine(htmlBody); var htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(htmlBody); // select script tags var scripts = htmlDocument.DocumentNode.SelectNodes("/html/body/script"); // preprocess result var uselessString = "window._sharedData = "; var scriptInnerText = scripts[0].InnerText .Substring(uselessString.Length) .Replace(";", ""); // serialize objects and fetch the user data dynamic jsonStuff = JObject.Parse(scriptInnerText); dynamic userProfile = jsonStuff["entry_data"]["ProfilePage"][0]["graphql"]["user"]; //await System.IO.File.WriteAllText("user.jason", JsonConvert.SerializeObject(userProfile)); // create an InstagramUser var instagramUser = new InstagramUser { FullName = userProfile.full_name, FollowerCount = userProfile.edge_followed_by.count, FollowingCount = userProfile.edge_follow.count }; return(instagramUser); } else { throw new Exception($"Something wrong happened {response.StatusCode} - {response.ReasonPhrase} - {response.RequestMessage}"); } } }
// GET: Instagram/Media /* Returns latest media of currently authenticated user. The InstagramSession * object for the current session is preserved through .NET Session State. * */ public ActionResult Media() { /* No current session could be found, back to the homepage. */ if (this.Session["CurrentSession"] == null) { return(RedirectToAction("Index")); } /* Access the current InstagramSession and fetch user data/media. */ InstagramSession currentSession = (InstagramSession)this.Session["CurrentSession"]; IList <InstagramPost> recentMedia = currentSession.GetMedia(); InstagramUser currentUser = currentSession.GetUser(); /* Wrap the user and media into a single model and pass * that to the view for displaying purposes. */ MediaViewModel viewModel = new MediaViewModel { User = currentUser, Media = recentMedia }; return(View(viewModel)); }
private async void you_dont_follow_button_Clicked(object sender, EventArgs e) { var you_dont_follow_page_instance = new YouDontFollowPage(); you_dont_follow_page_instance.InstaApi = InstaApi; var usernames = new List <InstagramUser>(); foreach (var u in i_dont_follow_back) { var added_user = new InstagramUser { FullName = u.FullName, Username = u.UserName, ImageUrl = u.ProfilePicUrl }; usernames.Add(added_user); } you_dont_follow_page_instance.i_dont_follow_back = usernames; await Navigation.PushAsync(you_dont_follow_page_instance); }
private static async Task <IInstaApi> TryToLoginAsync(InstagramUser user) { var address = "217.170.219.6"; var port = "41258"; var httpHndler = new HttpClientHandler { Proxy = new WebProxy(string.Format("{0}:{1}", address, port), false), UseProxy = true //PreAuthenticate = true, //UseDefaultCredentials = false, //Credentials = new System.Net.NetworkCredential(proxyServerSettings.UserName, // proxyServerSettings.Password), }; var api = InstaApiBuilder.CreateBuilder() //.UseHttpClientHandler(httpHndler) .SetUser(new UserSessionData { UserName = user.UserName, Password = user.Password }) .UseLogger(new DebugLogger(LogLevel.Exceptions)).Build(); var loginRequest = await api.LoginAsync(); if (loginRequest.Succeeded) { Console.WriteLine("Logged in!"); } else { var errorMsg = loginRequest.Info.Message; Console.WriteLine("Error Logging in!" + Environment.NewLine + errorMsg); if (errorMsg == "Please wait a few minutes before you try again.") { Thread.Sleep(TimeSpan.FromMinutes(5)); } } return(api); }
private async Task<InstagramUser> ScrapeAsync(string ProfileName) { try { using (var client = new HttpClient()) { var response = await client.GetAsync($"https://www.instagram.com/{ProfileName}"); if (response.IsSuccessStatusCode) { var htmlBody = await response.Content.ReadAsStringAsync(); return InstagramUser.FromHtml(htmlBody); } OutputError($"Profile {ProfileName} doesn't exist"); } return null; } catch (Exception ex) { OutputError($"{ProfileName} is not a valid user or something else happened: {ex.Message}"); return null; } }
public static async Task ScrapeInstagram(string url) { using (var httpClient = new HttpClient()) { var response = await httpClient.GetAsync(url); if (response.IsSuccessStatusCode) { // create html document var htmlBody = await response.Content.ReadAsStringAsync(); var htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(htmlBody); //Console.WriteLine(htmlBody); // select script tags var scripts = htmlDocument.DocumentNode.SelectNodes("/html/body/script"); //preprocess result var uselessString = "window._sharedData = "; //Console.WriteLine($"Got cool array of scripts of size { scripts.Count }"); var scriptInnerText = scripts[0].InnerText.Substring(uselessString.Length).Replace(";", ""); // serialize objects and fetch the user data dynamic jsonStuff = JObject.Parse(scriptInnerText); dynamic userProfile = jsonStuff["entry_data"]["ProfilePage"][0]["graphql"]["user"]; var instagramUser = new InstagramUser { FullName = userProfile.full_name, FollowerCount = userProfile.edge_followed_by.count, FollowingCount = userProfile.edge_follow.count }; instagramUser.Display(); } } }
public void StartActionChangeprofile(ref InstagramUser obj_Gramuser) { try { if (edit_profile) { int Username = RandomNumberGenerator.GenerateRandom(0, ClGlobul.ListUsername_Manageprofile.Count); string email = ClGlobul.ListUsername_Manageprofile[Username]; //ChangeEmail(email, ref objPinChange); Start_Change_Profile(email, ref obj_Gramuser); } if (edit_password) { int Username = RandomNumberGenerator.GenerateRandom(0, ClGlobul.ListPassword.Count); string Password = ClGlobul.ListPassword[Username]; Start_Change_password(Password, ref obj_Gramuser); } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
public void CommentOperation(string Acc, string[] Hash) { try { lstThreadsCommentPoster.Add(Thread.CurrentThread); lstThreadsCommentPoster.Distinct(); Thread.CurrentThread.IsBackground = true; } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } try { string status = string.Empty; string[] arrAcc = Regex.Split(Acc, ":"); InstagramUser objInstagramUser = new InstagramUser(arrAcc[0], arrAcc[1], arrAcc[2], arrAcc[3]); GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper(); objInstagramUser.globusHttpHelper = objGlobusHttpHelper; AccountManager objAccountManager = new AccountManager(); if (!objInstagramUser.isloggedin) { status = objAccountManager.LoginUsingGlobusHttp(ref objInstagramUser); } if (status == "Success" || (objInstagramUser.isloggedin)) { foreach (string itemHash in Hash) { if (!string.IsNullOrEmpty(itemHash)) { //Operation string[] Data_ID = Regex.Split(itemHash, ","); string daaa = objInstagramUser.username; foreach (string Photo_ID in Data_ID) { if (!string.IsNullOrEmpty(Photo_ID)) { // CommentOnSnapsVideos(ref objInstagramUser, Photo_ID); getComment(Photo_ID, ref objInstagramUser); } else { break; } if (minDelayCommentPoster != 0) { mindelay = minDelayCommentPoster; } if (maxDelayCommentPoster != 0) { maxdelay = maxDelayCommentPoster; } Random obj_rn = new Random(); int delay = RandomNumberGenerator.GenerateRandom(mindelay, maxdelay); delay = obj_rn.Next(mindelay, maxdelay); GlobusLogHelper.log.Info("[ " + DateTime.Now + " ] => [ Delay For " + delay + " Seconds ]"); Thread.Sleep(delay * 1000); } } GlobusLogHelper.log.Info("========================="); GlobusLogHelper.log.Info("Process Completed !!!"); GlobusLogHelper.log.Info("========================="); } } } catch (Exception ex) { GlobusLogHelper.log.Info("Error : " + ex.StackTrace); } }
public void StartCommentPoster() { countThreadControllerCommentPoster = 0; try { int numberOfAccountPatch = 25; if (NoOfThreadsCommentPoster > 0) { numberOfAccountPatch = NoOfThreadsCommentPoster; } List <List <string> > list_listAccounts = new List <List <string> >(); if (IGGlobals.listAccounts.Count >= 1) { list_listAccounts = Utils.Split(IGGlobals.listAccounts, numberOfAccountPatch); foreach (List <string> listAccounts in list_listAccounts) { foreach (string account in listAccounts) { try { lock (lockrThreadControlleCommentPoster) { try { if (countThreadControllerCommentPoster >= listAccounts.Count) { Monitor.Wait(lockrThreadControlleCommentPoster); } string acc = account.Remove(account.IndexOf(':')); //Run a separate thread for each account InstagramUser item = null; IGGlobals.loadedAccountsDictionary.TryGetValue(acc, out item); if (item != null) { Thread profilerThread = new Thread(StartMultiThreadsCommentPoster); profilerThread.Name = "workerThread_Profiler_" + acc; profilerThread.IsBackground = true; profilerThread.Start(new object[] { item }); countThreadControllerCommentPoster++; } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
public string Comment(string commentId, string CommentMsg, ref InstagramUser objInstagramUser) { int intProxyPort = 80; if (!string.IsNullOrEmpty(objInstagramUser.proxyport) && IdCheck.IsMatch(objInstagramUser.proxyport)) { intProxyPort = int.Parse(objInstagramUser.proxyport); } NameValueCollection namevalue = new NameValueCollection(); string FollowedPageSource = string.Empty; try { string CommentIdlink = string.Empty; string commentIdLoggedInLink = string.Empty; if (!commentId.Contains("http://web.stagram.com/")) { CommentIdlink = "http://web.stagram.com/p/" + commentId + "/"; commentIdLoggedInLink = "http://websta.me/p/" + commentId; } if(IsCommentWithSpecificFollowers) { try{ string NOOfCountOfFollowers = string.Empty; string pagesourceTemp = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(commentIdLoggedInLink),objInstagramUser.proxyip,intProxyPort,objInstagramUser.proxyusername,objInstagramUser.proxypassword); string userName = GlobusHttpHelper.getBetween(pagesourceTemp,"class=\"username\">","</a>"); if(!string.IsNullOrEmpty(userName)) { string urlTemp="http://websta.me/n/"+userName; pagesourceTemp = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(urlTemp),objInstagramUser.proxyip,intProxyPort,objInstagramUser.proxyusername,objInstagramUser.proxypassword); NOOfCountOfFollowers=GlobusHttpHelper.getBetween(pagesourceTemp,"class=\"counts_followed_by\">","</span>").Replace(",","").Trim(); NOOfCountOfFollowers=Convert.ToString(NOOfCountOfFollowers); try { if(Convert.ToInt32(NOOfCountOfFollowers)>=Convert.ToInt32(countNOOfFollowers)) { } else { FollowedPageSource="NO of Followers unmatched"; return FollowedPageSource; } } catch (Exception ex) { } } else { FollowedPageSource="Unable to find No of follwers of user."; return FollowedPageSource; } } catch{} } #region Change string url = "http://websta.me/api/comments/" + commentId; bool checkunicode = ContainsUnicodeCharacter(CommentMsg); string CmntMSG = string.Empty; if (checkunicode == false) { CmntMSG = Uri.EscapeDataString(CommentMsg); //CmntMSG = CommentMsg.Replace(" ", "+"); } else { CmntMSG = Uri.EscapeDataString(CommentMsg); } string commentPostData = "comment=+" + CmntMSG + "&media_id=" + commentId; FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri(url), commentPostData, CommentIdlink, ""); if (!FollowedPageSource.Contains("status\":\"OK\"")) { try { FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri(url), commentPostData, CommentIdlink, ""); string postUrl = "https://www.instagram.com/web/comments/" + commentId + "/add/"; string postData = "comment_text=" + CmntMSG; FollowedPageSource = objInstagramUser.globusHttpHelper.PostDataWithInstagram(new Uri(postUrl), postData, "https://www.instagram.com/"); } catch { }; } if (FollowedPageSource.Contains("status\":\"OK\"") || FollowedPageSource.Contains("created_time")) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_SuccessfullyCommentedInstagram); if(FBGlobals.typeOfOperatingSystem.Contains("Win")||FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_SuccessfullyCommentedInstagram); } else if(FBGlobals.typeOfOperatingSystem.Contains("Unix")||FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_LinuxSuccessfullyCommentedInstagram); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_SuccessfullyCommentedInstagram); } FollowedPageSource = "Successs"; } else { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_FailCommentedInstagram); if(FBGlobals.typeOfOperatingSystem.Contains("Win")||FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_FailCommentedInstagram); } else if(FBGlobals.typeOfOperatingSystem.Contains("Unix")||FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_LinuxFailCommentedInstagram); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_FailCommentedInstagram); } FollowedPageSource = "Fail"; } #endregion } catch (Exception ex) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+commentId,FBGlobals.path_FailCommentedInstagram); if(FBGlobals.typeOfOperatingSystem.Contains("Win")||FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+commentId,FBGlobals.path_FailCommentedInstagram); } else if(FBGlobals.typeOfOperatingSystem.Contains("Unix")||FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+commentId,FBGlobals.path_LinuxFailCommentedInstagram); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+commentId,FBGlobals.path_FailCommentedInstagram); } FollowedPageSource = string.Empty; } return FollowedPageSource; }
private void CheckedAccountFromDataGrid_Click(object sender, RoutedEventArgs e) { string accountUser = string.Empty; string accountPass = string.Empty; string proxyAddress = string.Empty; string proxyPort = string.Empty; string proxyUserName = string.Empty; string proxyPassword = string.Empty; string status = string.Empty; try { foreach (GramDominator.Classes.Validation objValidation in dgv_List_of_Account.SelectedItems) { } DataSet ds = null; try { ds = Qm.SelectAccountreport(""); } catch (Exception ex) { GlobusLogHelper.log.Info("Error:" + ex.StackTrace); } IGGlobals.listAccounts.Clear(); for (int noRow = 0; noRow < ds.Tables[0].Rows.Count; noRow++) { string account = ds.Tables[0].Rows[noRow].ItemArray[0].ToString() + ":" + ds.Tables[0].Rows[noRow].ItemArray[1].ToString() + ":" + ds.Tables[0].Rows[noRow].ItemArray[2].ToString() + ":" + ds.Tables[0].Rows[noRow].ItemArray[3].ToString() + ":" + ds.Tables[0].Rows[noRow].ItemArray[4].ToString() + ":" + ds.Tables[0].Rows[noRow].ItemArray[5].ToString(); IGGlobals.listAccounts.Add(account); // dv.AllowNew = false; accountUser = ds.Tables[0].Rows[noRow].ItemArray[0].ToString(); accountPass = ds.Tables[0].Rows[noRow].ItemArray[1].ToString(); proxyAddress = ds.Tables[0].Rows[noRow].ItemArray[2].ToString(); proxyPort = ds.Tables[0].Rows[noRow].ItemArray[3].ToString(); proxyUserName = ds.Tables[0].Rows[noRow].ItemArray[4].ToString(); proxyPassword = ds.Tables[0].Rows[noRow].ItemArray[5].ToString(); InstagramUser objInstagramUser = new InstagramUser("", "", "", ""); objInstagramUser.username = accountUser; objInstagramUser.password = accountPass; objInstagramUser.proxyip = proxyAddress; objInstagramUser.proxyport = proxyPort; objInstagramUser.proxyusername = proxyUserName; objInstagramUser.proxypassword = proxyPassword; try { IGGlobals.loadedAccountsDictionary.Add(objInstagramUser.username, objInstagramUser); } catch { } } } catch (Exception ex) { GlobusLogHelper.log.Info("Error :" + ex.StackTrace); } }
public string photolike(string PhotoId, ref InstagramUser objInstagramUser) { NameValueCollection namevalue = new NameValueCollection(); string Photolink = string.Empty; string FollowedPageSource = string.Empty; string like = string.Empty; try { int intProxyPort = 80; if (!string.IsNullOrEmpty(objInstagramUser.proxyport) && IdCheck.IsMatch(objInstagramUser.proxyport)) { intProxyPort = int.Parse(objInstagramUser.proxyport); } if (!PhotoId.Contains("http://web.stagram.com/")) { Photolink = "http://websta.me/api/like/" + PhotoId + "/".Replace("http://websta.me/p/", ""); } else { Photolink = PhotoId; } string PageContent = objInstagramUser.globusHttpHelper.getHtmlfromUrl(new Uri(Photolink), "",""); if (!PageContent.Contains("\"message\":\"LIKED\"")) { PageContent = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(Photolink), objInstagramUser.proxyip, intProxyPort, objInstagramUser.proxyusername, objInstagramUser.proxypassword); try { // FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri(url), commentPostData, CommentIdlink, ""); if (!PageContent.Contains("\"message\":\"LIKED\"")) { string postUrl = "https://www.instagram.com/web/likes/" + PhotoId + "/like/"; string postData = ""; PageContent = objInstagramUser.globusHttpHelper.PostDataWithInstagram(new Uri(postUrl), postData, "https://www.instagram.com/"); } } catch { }; } if (PageContent.Contains("message\":\"LIKED\"")) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_SuccessFullyLike); if(FBGlobals.typeOfOperatingSystem.Contains("Win")||FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_SuccessFullyLike); } else if(FBGlobals.typeOfOperatingSystem.Contains("Unix")||FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_LinuxSuccessFullyLike); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_SuccessFullyLike); } FollowedPageSource = "LIKED"; } else if (string.IsNullOrEmpty(FollowedPageSource)) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_FailedLike); if(FBGlobals.typeOfOperatingSystem.Contains("Win")||FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_FailedLike); } else if(FBGlobals.typeOfOperatingSystem.Contains("Unix")||FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_LinuxFailedLike); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_FailedLike); } FollowedPageSource = "All ready LIKED"; } } catch { } return FollowedPageSource; }
public string UnFollow(string UserName, ref InstagramUser objInstagramUser) { try { int intProxyPort = 80; if (!string.IsNullOrEmpty(objInstagramUser.proxyport) && IdCheck.IsMatch(objInstagramUser.proxyport)) { intProxyPort = int.Parse(objInstagramUser.proxyport); } NameValueCollection nameval = new NameValueCollection(); if (!UserName.Contains("http://websta.me/n/")) { UserName = "******" + UserName + "/"; } string UserPageContent = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(UserName),objInstagramUser.proxyip,intProxyPort,objInstagramUser.proxyusername,objInstagramUser.proxypassword); try { string PK = string.Empty; if (UserPageContent.Contains("")) { PK = GlobusHttpHelper.getBetween(UserPageContent, "id=\"follow_btn_wrapper\"", ">").Replace("data-target=", "").Replace("\"","").Trim(); } if (string.IsNullOrEmpty(PK)) { PK = GlobusHttpHelper.getBetween(UserPageContent, "id=\"message_user_id", ">").Replace(">", "").Replace("value=",string.Empty).Replace("\"",string.Empty).Trim();//.Replace("\"", "").Trim(); } string PostData = "action=unfollow";//"&pk=" + PK + "&t=9208"; string FollowedPageSource=string.Empty; FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri("http://websta.me/api/relationships/" + PK), PostData, UserName, "http://websta.me"); //nameval.Add("Origin", "http://web.stagram.com"); //nameval.Add("X-Requested-With", "XMLHttpRequest"); if (FollowedPageSource.Contains("OK")) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_SuccessFullyFollowing); if(FBGlobals.typeOfOperatingSystem.Contains("Win")||FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_SuccessFullyFollowing); } else if(FBGlobals.typeOfOperatingSystem.Contains("Unix")||FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_LinuxSuccessFullyFollowing); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_SuccessFullyFollowing); } return "UnFollowed"; } else { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_FailedFollowing); if(FBGlobals.typeOfOperatingSystem.Contains("Win")||FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_FailedFollowing); } else if(FBGlobals.typeOfOperatingSystem.Contains("Unix")||FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_LinuxFailedFollowing); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_FailedFollowing); } return "NotUnFollowed"; } } catch (Exception ex) { return "NOFollow option is not available In page...!!"; //Console.Write (ex.Message); } } catch (Exception ex) { return "NotUnFollowed"; } }
public string Comment(string commentId, string CommentMsg, ref InstagramUser objInstagramUser) { int intProxyPort = 80; if (!string.IsNullOrEmpty(objInstagramUser.proxyport) && IdCheck.IsMatch(objInstagramUser.proxyport)) { intProxyPort = int.Parse(objInstagramUser.proxyport); } NameValueCollection namevalue = new NameValueCollection(); string FollowedPageSource = string.Empty; try { string CommentIdlink = string.Empty; string commentIdLoggedInLink = string.Empty; if (!commentId.Contains("http://web.stagram.com/")) { CommentIdlink = "http://web.stagram.com/p/" + commentId + "/"; commentIdLoggedInLink = "http://websta.me/p/" + commentId; } if (IsCommentWithSpecificFollowers) { try{ string NOOfCountOfFollowers = string.Empty; string pagesourceTemp = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(commentIdLoggedInLink), objInstagramUser.proxyip, intProxyPort, objInstagramUser.proxyusername, objInstagramUser.proxypassword); string userName = GlobusHttpHelper.getBetween(pagesourceTemp, "class=\"username\">", "</a>"); if (!string.IsNullOrEmpty(userName)) { string urlTemp = "http://websta.me/n/" + userName; pagesourceTemp = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(urlTemp), objInstagramUser.proxyip, intProxyPort, objInstagramUser.proxyusername, objInstagramUser.proxypassword); NOOfCountOfFollowers = GlobusHttpHelper.getBetween(pagesourceTemp, "class=\"counts_followed_by\">", "</span>").Replace(",", "").Trim(); NOOfCountOfFollowers = Convert.ToString(NOOfCountOfFollowers); try { if (Convert.ToInt32(NOOfCountOfFollowers) >= Convert.ToInt32(countNOOfFollowers)) { } else { FollowedPageSource = "NO of Followers unmatched"; return(FollowedPageSource); } } catch (Exception ex) { } } else { FollowedPageSource = "Unable to find No of follwers of user."; return(FollowedPageSource); } } catch {} } #region Change string url = "http://websta.me/api/comments/" + commentId; bool checkunicode = ContainsUnicodeCharacter(CommentMsg); string CmntMSG = string.Empty; if (checkunicode == false) { CmntMSG = Uri.EscapeDataString(CommentMsg); //CmntMSG = CommentMsg.Replace(" ", "+"); } else { CmntMSG = Uri.EscapeDataString(CommentMsg); } string commentPostData = "comment=+" + CmntMSG + "&media_id=" + commentId; FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri(url), commentPostData, CommentIdlink, ""); if (!FollowedPageSource.Contains("status\":\"OK\"")) { try { FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri(url), commentPostData, CommentIdlink, ""); string postUrl = "https://www.instagram.com/web/comments/" + commentId + "/add/"; string postData = "comment_text=" + CmntMSG; FollowedPageSource = objInstagramUser.globusHttpHelper.PostDataWithInstagram(new Uri(postUrl), postData, "https://www.instagram.com/"); } catch { }; } if (FollowedPageSource.Contains("status\":\"OK\"") || FollowedPageSource.Contains("created_time")) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_SuccessfullyCommentedInstagram); if (FBGlobals.typeOfOperatingSystem.Contains("Win") || FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + CmntMSG + ":" + commentId, FBGlobals.path_SuccessfullyCommentedInstagram); } else if (FBGlobals.typeOfOperatingSystem.Contains("Unix") || FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + CmntMSG + ":" + commentId, FBGlobals.path_LinuxSuccessfullyCommentedInstagram); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + CmntMSG + ":" + commentId, FBGlobals.path_SuccessfullyCommentedInstagram); } FollowedPageSource = "Successs"; } else { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+CmntMSG+":"+commentId,FBGlobals.path_FailCommentedInstagram); if (FBGlobals.typeOfOperatingSystem.Contains("Win") || FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + CmntMSG + ":" + commentId, FBGlobals.path_FailCommentedInstagram); } else if (FBGlobals.typeOfOperatingSystem.Contains("Unix") || FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + CmntMSG + ":" + commentId, FBGlobals.path_LinuxFailCommentedInstagram); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + CmntMSG + ":" + commentId, FBGlobals.path_FailCommentedInstagram); } FollowedPageSource = "Fail"; } #endregion } catch (Exception ex) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+commentId,FBGlobals.path_FailCommentedInstagram); if (FBGlobals.typeOfOperatingSystem.Contains("Win") || FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + commentId, FBGlobals.path_FailCommentedInstagram); } else if (FBGlobals.typeOfOperatingSystem.Contains("Unix") || FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + commentId, FBGlobals.path_LinuxFailCommentedInstagram); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + commentId, FBGlobals.path_FailCommentedInstagram); } FollowedPageSource = string.Empty; } return(FollowedPageSource); }
public string UnFollow(string UserName, ref InstagramUser objInstagramUser) { try { int intProxyPort = 80; if (!string.IsNullOrEmpty(objInstagramUser.proxyport) && IdCheck.IsMatch(objInstagramUser.proxyport)) { intProxyPort = int.Parse(objInstagramUser.proxyport); } NameValueCollection nameval = new NameValueCollection(); if (!UserName.Contains("http://websta.me/n/")) { UserName = "******" + UserName + "/"; } string UserPageContent = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(UserName), objInstagramUser.proxyip, intProxyPort, objInstagramUser.proxyusername, objInstagramUser.proxypassword); try { string PK = string.Empty; if (UserPageContent.Contains("")) { PK = GlobusHttpHelper.getBetween(UserPageContent, "id=\"follow_btn_wrapper\"", ">").Replace("data-target=", "").Replace("\"", "").Trim(); } if (string.IsNullOrEmpty(PK)) { PK = GlobusHttpHelper.getBetween(UserPageContent, "id=\"message_user_id", ">").Replace(">", "").Replace("value=", string.Empty).Replace("\"", string.Empty).Trim(); //.Replace("\"", "").Trim(); } string PostData = "action=unfollow"; //"&pk=" + PK + "&t=9208"; string FollowedPageSource = string.Empty; FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri("http://websta.me/api/relationships/" + PK), PostData, UserName, "http://websta.me"); //nameval.Add("Origin", "http://web.stagram.com"); //nameval.Add("X-Requested-With", "XMLHttpRequest"); if (FollowedPageSource.Contains("OK")) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_SuccessFullyFollowing); if (FBGlobals.typeOfOperatingSystem.Contains("Win") || FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + UserName, FBGlobals.path_SuccessFullyFollowing); } else if (FBGlobals.typeOfOperatingSystem.Contains("Unix") || FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + UserName, FBGlobals.path_LinuxSuccessFullyFollowing); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + UserName, FBGlobals.path_SuccessFullyFollowing); } return("UnFollowed"); } else { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+UserName,FBGlobals.path_FailedFollowing); if (FBGlobals.typeOfOperatingSystem.Contains("Win") || FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + UserName, FBGlobals.path_FailedFollowing); } else if (FBGlobals.typeOfOperatingSystem.Contains("Unix") || FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + UserName, FBGlobals.path_LinuxFailedFollowing); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + UserName, FBGlobals.path_FailedFollowing); } return("NotUnFollowed"); } } catch (Exception ex) { return("NOFollow option is not available In page...!!"); //Console.Write (ex.Message); } } catch (Exception ex) { return("NotUnFollowed"); } }
public string photolike(string PhotoId, ref InstagramUser objInstagramUser) { NameValueCollection namevalue = new NameValueCollection(); string Photolink = string.Empty; string FollowedPageSource = string.Empty; string like = string.Empty; try { int intProxyPort = 80; if (!string.IsNullOrEmpty(objInstagramUser.proxyport) && IdCheck.IsMatch(objInstagramUser.proxyport)) { intProxyPort = int.Parse(objInstagramUser.proxyport); } if (!PhotoId.Contains("http://web.stagram.com/")) { Photolink = "http://websta.me/api/like/" + PhotoId + "/".Replace("http://websta.me/p/", ""); } else { Photolink = PhotoId; } string PageContent = objInstagramUser.globusHttpHelper.getHtmlfromUrl(new Uri(Photolink), "", ""); if (!PageContent.Contains("\"message\":\"LIKED\"")) { PageContent = objInstagramUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri(Photolink), objInstagramUser.proxyip, intProxyPort, objInstagramUser.proxyusername, objInstagramUser.proxypassword); try { // FollowedPageSource = objInstagramUser.globusHttpHelper.postFormData(new Uri(url), commentPostData, CommentIdlink, ""); if (!PageContent.Contains("\"message\":\"LIKED\"")) { string postUrl = "https://www.instagram.com/web/likes/" + PhotoId + "/like/"; string postData = ""; PageContent = objInstagramUser.globusHttpHelper.PostDataWithInstagram(new Uri(postUrl), postData, "https://www.instagram.com/"); } } catch { }; } if (PageContent.Contains("message\":\"LIKED\"")) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_SuccessFullyLike); if (FBGlobals.typeOfOperatingSystem.Contains("Win") || FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + PhotoId, FBGlobals.path_SuccessFullyLike); } else if (FBGlobals.typeOfOperatingSystem.Contains("Unix") || FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + PhotoId, FBGlobals.path_LinuxSuccessFullyLike); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + PhotoId, FBGlobals.path_SuccessFullyLike); } FollowedPageSource = "LIKED"; } else if (string.IsNullOrEmpty(FollowedPageSource)) { //GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username+":"+PhotoId,FBGlobals.path_FailedLike); if (FBGlobals.typeOfOperatingSystem.Contains("Win") || FBGlobals.typeOfOperatingSystem.Contains("win")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + PhotoId, FBGlobals.path_FailedLike); } else if (FBGlobals.typeOfOperatingSystem.Contains("Unix") || FBGlobals.typeOfOperatingSystem.Contains("unix")) { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + PhotoId, FBGlobals.path_LinuxFailedLike); } else { GlobusFileHelper.AppendStringToTextfileNewLine(objInstagramUser.username + ":" + PhotoId, FBGlobals.path_FailedLike); } FollowedPageSource = "All ready LIKED"; } } catch { } return(FollowedPageSource); }
private void LoadAccountMultithreaded(string item) { //counter = counter + 1; try { counter++; string account = item; string[] AccArr = account.Split(':'); if (AccArr.Count() > 1) { string accountUser = string.Empty; accountUser = account.Split(':')[0]; string accountPass = account.Split(':')[1]; string proxyAddress = string.Empty; string proxyPort = string.Empty; string proxyUserName = string.Empty; string proxyPassword = string.Empty; string Status = string.Empty; int DataCount = account.Split(':').Length; if (DataCount == 2) { //Globals.accountMode = AccountMode.NoProxy; } else if (DataCount == 4) { proxyAddress = account.Split(':')[2]; proxyPort = account.Split(':')[3]; } else if (DataCount > 5 && DataCount < 7) { proxyAddress = account.Split(':')[2]; proxyPort = account.Split(':')[3]; proxyUserName = account.Split(':')[4]; proxyPassword = account.Split(':')[5]; } else if (DataCount >= 7) { proxyAddress = account.Split(':')[2]; proxyPort = account.Split(':')[3]; proxyUserName = account.Split(':')[4]; proxyPassword = account.Split(':')[5]; Status = "Not Checked"; } Status = "Not Checked"; // dt.Rows.Add(accountUser, accountPass, proxyAddress, proxyPort, proxyUserName, proxyPassword, Status); // dt.Rows.Add(accountUser, accountPass, proxyAddress, proxyPort, proxyUserName, proxyPassword); string insertQuery = "insert into AccountVerification(Username,Password,ProxyAddress,ProxyPort,ProxyUsername,ProxyPassword,Status) values ('" + accountUser + "','" + accountPass + "','" + proxyAddress + "','" + proxyPort + "','" + proxyUserName + "','" + proxyPassword + "','" + Status + "') "; BaseLib.DataBaseHandler.InsertQuery(insertQuery, "AccountVerification"); try { InstagramUser objInstagramUser = new InstagramUser(accountUser, accountPass, proxyAddress, proxyPort); objInstagramUser.username = accountUser; objInstagramUser.password = accountPass; objInstagramUser.proxyip = proxyAddress; objInstagramUser.proxyport = proxyPort; objInstagramUser.proxyusername = proxyUserName; objInstagramUser.proxypassword = proxyPassword; IGGlobals.loadedAccountsDictionary.Add(objInstagramUser.username, objInstagramUser); IGGlobals.listAccounts.Add(objInstagramUser.username + ":" + objInstagramUser.password + ":" + objInstagramUser.proxyip + ":" + objInstagramUser.proxyport + ":" + objInstagramUser.proxyusername + ":" + objInstagramUser.proxypassword); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } ///Set this to "0" if loading unprofiled accounts /// string profileStatus = "0"; } else { GlobusLogHelper.log.Info("Account has some problem : " + item); GlobusLogHelper.log.Debug("Account has some problem : " + item); } lbl_AccountVerification_Report_NoOfAccountLoaded.Dispatcher.Invoke(new Action(() => { lbl_AccountVerification_Report_NoOfAccountLoaded.Content = IGGlobals.listAccounts.Count.ToString(); })); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } finally { counter--; } }
public InstagramUser Insert(InstagramUser entity) { entity.Id = Db.Insert(_sqlInsert, CreateParams(entity)); return(entity); }