static void PostNotificationToSlack(MeetupNotification meetupNews) { var content = new StringContent( JsonConvert.SerializeObject(new { text = PrepareSlackMessage(meetupNews) }), Encoding.UTF8, "application/json"); _http.PostAsync(_slackWebhookUrl, content).Wait(); }
static string PrepareSlackMessage(MeetupNotification meetupNews) { var desc = Regex.Replace(meetupNews.text, @"<b>(.*?)<\/b>", @"*$1*"); return string.Format("{0} [<{1}|link>]", desc, meetupNews.link); }