Skip to content

Instantly share code, notes, and snippets.

@SQLDBAWithABeard
Last active June 29, 2020 14:05
Show Gist options
  • Save SQLDBAWithABeard/f41f75a0935aa42207bae7fa83776c16 to your computer and use it in GitHub Desktop.
Save SQLDBAWithABeard/f41f75a0935aa42207bae7fa83776c16 to your computer and use it in GitHub Desktop.
MVP NUmbers
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"kernelspec": {
"name": "powershell",
"display_name": "PowerShell"
},
"language_info": {
"name": "powershell",
"codemirror_mode": "shell",
"mimetype": "text/x-sh",
"file_extension": ".ps1"
}
},
"nbformat_minor": 2,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": [
"Scrape MVP site for Number of Awards"
],
"metadata": {
"azdata_cell_guid": "428cd8c9-9b29-426d-be55-55f72c3d365b"
}
},
{
"cell_type": "code",
"source": [
"$url = 'https://mvp.microsoft.com/en-us/PublicProfile/5002693'\r\n",
"$Page = Invoke-WebRequest -Uri $url\r\n",
"$page.RawContent -match '(?smi)Number of MVP Awards:<\\/div>\\s.*<div class=\"ly infoContent\">(\\d)'\r\n",
"$Matches[1]"
],
"metadata": {
"azdata_cell_guid": "adacbefe-e31e-4d36-a246-cd390b5e503e"
},
"outputs": [
{
"name": "stdout",
"text": "True\n3\n",
"output_type": "stream"
}
],
"execution_count": 1
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment