Ejemplo n.º 1
0
 public override void Process(BotStateBuilder botState)
 {
     _loginPage.GoToPageUrl();
     _loginPage.EnterTextToLoginTextbox(Login);
     _loginPage.EnterTextToPasswordTextbox(Password);
     _loginPage.PressOnLoginButton();
     Thread.Sleep(1000);
     if (botState.Driver.Url.Contains(_loginPage.GetPageUrl()))
     {
         throw new AuthenticationException("Check your login or password, they may be incorrect");
     }
     Configs.Logger.Info($"Login to {Login} succeed!");
 }
 public override void Process(BotStateBuilder botState)
 {
     botState.ComponentsDataHandler.Add(this.GetType().Name, _searchResults);
     foreach (var link in _searchLinks)
     {
         _searchResultsPage.SetPageUrl(link.Value);
         _searchResultsPage.GoToPageUrl();
         _searchResultsPage.GoToPageUrl();
         _searchResultsPage.ScrollDownToPageEnd();
         _searchResults.Add(link.Key, _searchResultsPage.GetAllProfilesUrls());
         Configs.Logger.Info($"Resuls for link: {link.Key} was added to list");
     }
     SerDeUtils.SerializeToJsonFile(_searchResults, ResultsOutputPath);
 }
        public override void Process(BotStateBuilder botState)
        {
            if (!_loadResultsFromFile)
            {
                //Gets values from another components
                _searchResults =
                    (Dictionary <string, List <string> >)
                    botState.ComponentsDataHandler[typeof(SearchResultsScannerComponent).Name];
            }
            else
            {
                _searchResults = SerDeUtils.DeserializeJsonFile <Dictionary <string, List <string> > >(Path.Combine(_baseDir, _searchResultsFileName));
            }
            Wait wait = new Wait(botState.Driver);

            foreach (var searchResult in _searchResults)
            {
                foreach (var userProfile in searchResult.Value)
                {
                    _userProfilePage.SetPageUrl(userProfile);
                    Thread.Sleep(400);
                    _userProfilePage.GoToPageUrl();

                    var currentProfileDataPath = Path.Combine(_baseDir, "AllProfiles", searchResult.Key, Path.GetFileName(userProfile));
                    Directory.CreateDirectory(currentProfileDataPath);

                    //Get Profile info
                    GetProfileInfo(Path.Combine(currentProfileDataPath, "ProfileInfo.json"));
                    Configs.Logger.Debug($"Profile info was gathered | Profile: {userProfile}");

                    if (_postsCount != 0)
                    {
                        //Get Profile posts
                        GetProfilePosts(Path.Combine(currentProfileDataPath, "Posts.json"));
                        Configs.Logger.Debug($"Posts was gathered | Profile: {userProfile}");
                    }

                    if (_profilePhotosCount != 0 || _galleryPhotosCount != 0)
                    {
                        //Get All kind of photos
                        OpenAlbumViewForGettingPhotos(currentProfileDataPath);
                    }

                    Configs.Logger.Info($"Profile inteligence succed! Profile: {userProfile} | Search marker: {searchResult.Key}");
                }
            }
        }
Ejemplo n.º 4
0
        protected override MainManager _manualBuild()
        {
            #region Singletons
            ClientManager clientManager = new ClientManager(new CoreNetworkConfig());
            CameraService cameraService = new CameraService();

            TextDrawingService textDrawingService = null;
            BloomComponent     bloom = null;



            LidgrenMessenger        messenger      = new LidgrenMessenger(clientManager);
            MessageService_ToServer messageService = new MessageService_ToServer(messenger);



            LidgrenNetworkingService networkingService = new LidgrenNetworkingService();


            // Force the static to initialize now
            Utilities.NextUnique();

            #endregion

            List <IGameState> gameStates = new List <IGameState>();

            gameStates.Add(BotStateBuilder.BuildPlanetStateManager(clientManager, networkingService, new PhysicsConfig()));
            gameStates.Add(BotStateBuilder.BuildSpaceStateManager(clientManager, networkingService));
            gameStates.Add(_buildLoginStateManager(null, clientManager, messageService, networkingService));

            NewChatManager chatManager = new NewChatManager(clientManager);

            GameStateManager      gameStateManager      = BuildGameStateManager(cameraService, gameStates, textDrawingService, null);
            MainNetworkingManager mainNetworkingManager = new MainNetworkingManager(chatManager, clientManager, networkingService);

            return(new MainManager(bloom, textDrawingService, this, gameStateManager, _graphics, mainNetworkingManager));
        }
 public override void Prepare(BotStateBuilder botState)
 {
     _searchLinks       = SerDeUtils.DeserializeJsonFile <Dictionary <string, string> >(LinksInputPath);
     _searchResults     = new Dictionary <string, List <string> >();
     _searchResultsPage = new SearchResultsPage(botState.Driver);
 }
Ejemplo n.º 6
0
 public override void Prepare(BotStateBuilder botState)
 {
     _loginPage = new LoginPage(botState.Driver);
 }
 public override void Prepare(BotStateBuilder botState)
 {
     _userProfilePage = new UserProfilePage(botState.Driver);
 }
 public void BuildsWhenGivenAValidIStorageInstance()
 {
     var botState = new BotStateBuilder <FakeBotState>(new BotStateConfigurationBuilder(Mock.Of <IServiceCollection>()))
                    .UseStorage(Mock.Of <IStorage>())
                    .Build();
 }
Ejemplo n.º 9
0
 public abstract void Process(BotStateBuilder botState);
Ejemplo n.º 10
0
 public abstract void Prepare(BotStateBuilder botState);