Skip to content

Instantly share code, notes, and snippets.

private async Task HandleCommand(SocketMessage messageParam)
{
var message = messageParam as SocketUserMessage;
if (message == null) return;
var argPos = 0;
if (!(message.HasCharPrefix('.', ref argPos) ||
message.HasMentionPrefix(_discord.CurrentUser, ref argPos)) || message.Author.IsBot) return;
private static async Task CommandExecutedAsync(Optional<CommandInfo> command, ICommandContext context,
IResult result)
{
if (!command.IsSpecified) return;
if (result.IsSuccess) return;
if (result.ErrorReason == "The input text has too few parameters.")
await context.Channel.SendMessageAsync(
$"***.{command.Value.Name}*** is missing parameters. Use ***.help*** for more information.");
IEnumerable<List<string>> table = playerDoc.DocumentNode
.SelectSingleNode($"//*[@id='lg_team_user_leagues-{leagueId}']/div[4]/table/tbody")
.Descendants("tr")
.Skip(1)
.Where(tr => tr.Elements("td").Count() > 1)
.Select(tr => tr.Elements("td").Select(td => td.InnerText.Trim())
.Where(td => td.Contains("Reg")).ToList())
.ToList();
foreach (var careerStats in findCareerNode)
{
if (WebUtility.HtmlDecode(careerStats
.SelectSingleNode($"//*[@id='lg_team_user_leagues-{leagueId}']/div[{div}]/table/tbody/tr[{index}]/td[1]").InnerText).Trim() != seasonId)
{
index++;
continue;
}else if (WebUtility.HtmlDecode(careerStats
.SelectSingleNode(
$"//*[@id='lg_team_user_leagues-{leagueId}']/div[{div}]/table/tbody/tr[{index}]/td[2]")
List<List<string>> table = playerDoc.DocumentNode
.SelectSingleNode($"//*[@id='lg_team_user_leagues-{leagueId}']/div[4]/table/tbody")
.Descendants("tr")
.Skip(1)
//.Where(tr => tr.Elements("td").Count() > 1)
.Select(tr => tr.Elements("td")
.Select(td => td.InnerText.Trim()).ToList())
.ToList();
/*** MONITORR CUSTOM CSS ***/
/* NOTE: See wiki for detailed instructions/examples.
+ After applying custom CSS, clearing browser cache and reloading the Monitorr UI may be necessary.
+ Add "!important" to all CSS properties */
/* add custom CSS below this line */
*{box-sizing: content-box !important;}
@compil3
compil3 / build.gradle
Created October 1, 2014 22:19
dependents
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.github.gabrielemariotti.changeloglib:library:1.5.1'
compile 'com.android.support:appcompat-v7:+'
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NHLScraper.Data_Providers
{
public class TeamDataProvider
{
using System;
using System.Data.SqlServerCe;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using HtmlAgilityPack;
namespace NHLScraper
{
var cells = htmlDoc.DocumentNode
.SelectNodes("//table[@class='data stats']/tbody/tr")
.Select(node => new { playerRank = node.InnerText.Trim()})
.ToList();
foreach (var cell in cells)
{
Console.WriteLine("Rank: " + cell.playerRank);
Console.WriteLine();
}