public override async Task HandleAsync <T>(ContentRequestNotification notification, ILogger <T> logger) { RawTweet videoTweet = await twitterRepository.FindByIdAsync(notification.IdOfTweetBeingRepliedTo.Value); TweetNotification tweetNotification = new TweetNotification(videoTweet, notification.IdOfRequestingTweet, notification.RequestedBy); if (tweetNotification.HasVideo()) { var video = tweetNotification.GetVideo(); var request = tweetNotification.GetVideoRequest(video.Id); await scraperRepository.CaptureTwitterVideoAndRequestAsync(request, video); string response = video.GetResponseContent(settings.BaseUrl, request.RequestedBy); //send back response await twitterRepository.ReplyToTweetAsync(request.RequestingTweetId, response); logger.LogInformation($"Sent back this response -> {response}"); } else { logger.LogWarning($"The tweet being responded to didn't have a video -> {tweetNotification.TweetWithVideo.id}"); await base.HandleAsync(notification, logger); } }
public void LoadNotificationForScreenshot(TweetNotification tweet, int width, int height) { browser.LoadHtml(tweet.GenerateHtml(enableCustomCSS: false), "http://tweetdeck.twitter.com/?" + DateTime.Now.Ticks); Location = ControlExtensions.InvisibleLocation; FormBorderStyle = Program.UserConfig.ShowScreenshotBorder ? FormBorderStyle.FixedToolWindow : FormBorderStyle.None; SetNotificationSize(width, height, false); }
public FormNotificationExample(FormBrowser owner, PluginManager pluginManager) : base(owner, pluginManager, false) { string exampleTweetHTML = ScriptLoader.LoadResource("pages/example.html", true); #if DEBUG exampleTweetHTML = exampleTweetHTML.Replace("</p>", @"</p><div style='margin-top:256px'>Scrollbar test padding...</div>"); #endif exampleNotification = TweetNotification.Example(exampleTweetHTML, 95); }
protected override string GetTweetHTML(TweetNotification tweet) { string html = tweet.GenerateHtml("td-screenshot", this); foreach (InjectedHTML injection in plugins.NotificationInjections) { html = injection.InjectInto(html); } return(html); }
public FormNotificationExample(FormBrowser owner, PluginManager pluginManager) : base(owner, pluginManager, false) { browser.LoadingStateChanged += browser_LoadingStateChanged; string exampleTweetHTML = ScriptLoader.LoadResourceSilent("pages/example.html")?.Replace("{avatar}", TweetNotification.AppLogo.Url) ?? string.Empty; #if DEBUG exampleTweetHTML = exampleTweetHTML.Replace("</p>", @"</p><div style='margin-top:256px'>Scrollbar test padding...</div>"); #endif exampleNotification = new TweetNotification(string.Empty, string.Empty, "Home", exampleTweetHTML, 176, string.Empty, string.Empty); }
// notification methods public void ShowNotification(TweetNotification notification) { if (IsPaused) { tweetQueue.Enqueue(notification); } else { tweetQueue.Enqueue(notification); UpdateTitle(); if (totalTime == 0) { LoadNextNotification(); } } }
private void Awake() { Instance = this; m_Timestamp = -1f; }
public void LoadNotificationForScreenshot(TweetNotification tweet, int width, int height) { LoadTweet(tweet); SetNotificationSize(width, height); }
protected override string GetTweetHTML(TweetNotification tweet) { return(tweet.GenerateHtml(enableCustomCSS: false)); }
public void LoadNotificationHeadContents(string headContents) { form.InvokeAsyncSafe(() => { TweetNotification.SetHeadTag(headContents); }); }
public void LoadFontSizeClass(string fsClass) { form.InvokeAsyncSafe(() => { TweetNotification.SetFontSizeClass(fsClass); }); }