Esempio n. 1
0
        static void PostNotificationToSlack(MeetupNotification meetupNews)
        {
            var content = new StringContent(
                                JsonConvert.SerializeObject(new { text = PrepareSlackMessage(meetupNews) }),
                                Encoding.UTF8,
                                "application/json");

            _http.PostAsync(_slackWebhookUrl, content).Wait();
        }
Esempio n. 2
0
        static string PrepareSlackMessage(MeetupNotification meetupNews)
        {
            var desc = Regex.Replace(meetupNews.text, @"<b>(.*?)<\/b>", @"*$1*");

            return string.Format("{0} [<{1}|link>]", desc, meetupNews.link);
        }