Exemple #1
0
        static void BotWork(bool tweet)
        {
            m_timestamp = DateTime.Now;
            Tiler.Settings settings;

            string existingImage = "";
            string newPath       = Path.Combine(Persistence.WorkingDir, existingImage + ".png");

            if (!string.IsNullOrEmpty(existingImage) && !Test.IsTesting)
            {
                settings = Persistence.LoadSettings(Path.Combine(Persistence.WorkingDir, existingImage + ".xml"));
                Console.WriteLine(Tweet.Format(settings) + "\n");
            }
            else
            {
                // Generate the random settings.
                settings = GenSettings(tweet);
                Console.WriteLine(Tweet.Format(settings) + "\n");

                MakeTiling(settings);
                newPath = ArchiveToWorking(settings);
            }

            // Tweet it, but only if we aren't testing!
            if (tweet && !Test.IsTesting)
            {
                String message = Tweet.Format(settings);
                System.Console.WriteLine("Attempting tweet.");
                Tweet.ReadKeys();
                Tweet.Send(message, newPath).Wait();

                // Move to tweeted directory.
            }
        }
Exemple #2
0
        static async Task CheckRequests()
        {
            Tweet.ReadKeys();
            TwitterContext twitterCtx = Tweet.TwitterContext();

            // Mentions, but don't include normal replies.
            var tweets = await
                             (from tweet in twitterCtx.Status
                             where tweet.Type == StatusType.Mentions &&
                             tweet.ScreenName == "Tiling Bot" &&
                             tweet.ExcludeReplies == true &&
                             tweet.SinceID == 1024808727394713601
                             select tweet).ToListAsync();

            tweets.ForEach(
                mention => Console.WriteLine(
                    "Name: {0}, Tweet[{1}]: {2}\n",
                    mention.User.Name, mention.StatusID, mention.Text));
        }