Created
January 20, 2020 17:44
-
-
Save 1RedOne/8ceb22e662d6b75af2a956bec7407ad6 to your computer and use it in GitHub Desktop.
YouTubeCommentsTo WordCloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#goes along with this - https://gist.github.com/1RedOne/ca4e1ac49bf46bb7f30a503a3cae6fd2 and the post on FoxDeploy.com | |
#update to match your infoOutput.json path | |
if (!(get-module PSWordCloud)){ | |
write-warning "This depends on PSWordCloud being installed, please run `Install-Module PSWordCloud -Scope CurrentUser'" | |
break | |
} | |
$girlsFashion = get-content ".\1-9-2020-11_31_44AM-InfoOutput.json" | ConvertFrom-Json | |
$tags = $girlsFashion.Tags | select Tags | |
$mostPopularTags = $tags | Group-Object | Sort-Object Count -Descending | select -First 50 | |
$tags | ? $PSItem -in $mostPopularTags.Name | |
$tagCount = New-Object System.Collections.ArrayList | |
$mostPopularTags | % { | |
$name = $_.Name | |
"adding $name" | |
0..$_.Count | % { | |
$tagCount.Add($Name) | |
} | |
} | |
$tagCount | New-WordCloud -Path ..\GirlsFashion1.svg -FocusWord "GirlsFashion" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment