Skip to content

Instantly share code, notes, and snippets.

View PrateekKumarSingh's full-sized avatar

Prateek Singh PrateekKumarSingh

View GitHub Profile
#Extracting Best sentences with highest Ranks within the word limit
$BestSentences = Foreach($Item in (Get-SentenceRank $Content | Sort SentenceScore -Descending))
{
#Condition to limit Total word Count
$TotalWords += $Item.WordCount
If($TotalWords -gt $WordLimit)
{
break
<#.Synopsis
Returns Summary of a text document.
.DESCRIPTION
Returns the summary of a text document passed to it, depending upon your chosen word limit (Default 100 words).
.PARAMETER File
Text File with the content to summarize.
.PARAMETER WordLimit
Maximum number of words to be allowed in Summary
.EXAMPLE
PS Root\> Get-Summary -File .\Document.txt
Function Format-XMLIndent
{
[Cmdletbinding()]
[Alias("IndentXML")]
param
(
[xml]$Content,
[int]$Indent
)
Function Get-Nutrient
{
[cmdletbinding()]
[Alias("Nutrient")]
Param
(
[Parameter(Mandatory=$True)] [String] $Query
)
$Script:i=0
Function Get-Sentence
{
[cmdletBinding()]
[alias('gs')]
param(
[parameter(mandatory=$true)] [String]$Word,
[int] $count = 10,
[int] $WordLimit,
[Switch] $HighlightWord
)
[char[]]"vwxyz" | ForEach-Object {
$Alpha = $_
Get-DictionaryWord $Alpha -Verbose | ConvertTo-Json | `
Out-File ".\DictionaryAlphabetJSON\$Alpha.json"
Write-Host "Alphabet : $Alpha is complete" -ForegroundColor Yellow
}
Function Get-DictionaryWord
{
[Cmdletbinding()]
Param(
[String]$StartingAlphabet
)
$Results = @()
$i = 1
$StartingAlphabet = $StartingAlphabet.toLower()
$Content = @"
<HTML>
<BODY>
<h1> This is a heading </h1>
<P id='para1'>First Paragraph with some Random text</P>
<P>Second paragraph with more random text</P>
<A href="http://Geekeefy.wordpress.com">Cool Powershell blog</A>
</BODY>
</HTML>
"@ | Out-File File.html
[
{
"ImageURL": [
"https://pbs.twimg.com/profile_images/818406636800733184/br3nwOU0_400x400.jpg",
"https://abs.twimg.com/emoji/v2/72x72/1f3a4.png",
"https://abs.twimg.com/emoji/v2/72x72/1f47b.png",
"https://abs.twimg.com/emoji/v2/72x72/1f48b.png",
"https://abs.twimg.com/emoji/v2/72x72/1f1e6-1f1fa.png",
"https://abs.twimg.com/emoji/v2/72x72/1f483-1f3fb.png",
"https://abs.twimg.com/emoji/v2/72x72/2764.png",
Function Get-TwitterProfile
{
[cmdletbinding()]
Param(
$URL = "https://twitter.com/followers"
)
Begin
{}
Process