예제 #1
0
        private async Task <bool> CreatePost()
        {
            try
            {
                StateBot     stateBot = new StateBot();
                TextBot      textBot  = new TextBot();
                ImageBot     imageBot = new ImageBot();
                InstagramBot instaBot = new InstagramBot();

                Post post = checkBoxCache.Checked ? await stateBot.Load() : new Post();

                post.Keyword         = textBoxNameActor.Text;
                post.MaxNumberImages = (int)numberPhotos.Value;

                await textBot.FetchTvCreditsFromTMDB(post);

                await textBot.FetchBiographyFromWikipedia(post);

                await textBot.SanitizeContent(post);

                await stateBot.Save(post);

                await imageBot.FetchImagesFromGoogle(post);

                await imageBot.DownloadImages(post);

                await imageBot.ScaleImages(post);

                await stateBot.Save(post);

                await instaBot.LoginAsync();

                if (post.Images.Count <= 1)
                {
                    await instaBot.UploadPhotoAsync(post);
                }
                else
                {
                    await instaBot.UploadPhotosAlbumAsync(post);
                }

                await imageBot.DeleteFileImages(post);

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Falha ao postar as fotos, por favor tente novamente.", "Erro", MessageBoxButtons.OK);

                return(false);
            }
        }
예제 #2
0
 public void Disconnected()
 {
     _stateBot = StateBot.STATE_NONE;
 }
예제 #3
0
 public void BotDie()
 {
     StateBot = StateBot.Die;
     Destroy(gameObject);
 }
예제 #4
0
        /*
         * Couleur Assignée
         */


        public ArduinoBots(byte v_id)
        {
            Logger.GlobalLogger.info("Create new ArduinoBots id:" + v_id);
            _stateBot = StateBot.STATE_NONE;
        }