Skip to content

Commit 710806f

Browse files
committed
fixing
1 parent fabb68a commit 710806f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Scripts/auto.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ else{
3434
$QuestionContent = ($HTML.Content | pup -p 'head meta[name=\"description\"] attr{content}').Split("`n")
3535
$QuestionTitle = ($HTML.Content | pup -p 'div[class=\"question-title clearfix\"] h3 text{}').Trim().Split("`n")[1]
3636
$DIFFCULT = ($HTML.Content | pup 'div#desktop-side-bar ul li span text{}').Split(":")[2].Trim()
37-
$JSON = $HTML.Content | pup -p 'div[ng-controller=\"AceCtrl as aceCtrl\"] attr{ng-init}'
37+
$JSON = ($HTML.Content | pup -p 'body script:contains(\"codeDefinition\") text{}') | Out-String
38+
$JSONSTART = $JSON.IndexOf("=") + 1
39+
$JSONLENGTH = $JSON.LastIndexOf(";") - $JSONSTART
40+
$JSON = $JSON.Substring($JSONSTART,$JSONLENGTH).Trim().Replace("\u003D","=").Replace("\u003B",";").Replace("\u003C","<").Replace("\u003E",">").Replace("\u000A","`n").Replace("\u000D","`n").Replace("\u000D\u000A","`n").Replace("\u0022","""")
3841
}
3942
$AUTHOR = $command
4043
$CURRENT_DATE = Get-Date -format F

0 commit comments

Comments
 (0)