Skip to content

Instantly share code, notes, and snippets.

@1RedOne
Created January 20, 2020 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1RedOne/8ceb22e662d6b75af2a956bec7407ad6 to your computer and use it in GitHub Desktop.
Save 1RedOne/8ceb22e662d6b75af2a956bec7407ad6 to your computer and use it in GitHub Desktop.
YouTubeCommentsTo WordCloud
#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