關 於 本 站
國 軍 臂 章
軍 旅 札 記
後 備 之 友
留 言 版
後  版
檔 案 備 份
 
發新話題
列印

有雅虎部落格跟無名帳號的請注意

無名要關了 自己動手寫了個小工具
趕快打包吧!

1. mkdir c:\temp
2. copy/paste the script into c:\temp
3. update blogname in the script
4. run powershell.exe ".\Check-WRETCH-CC.ps1"

#######################################################################
#
# FileName: Check-WRETCH-CC.ps1
#
# Date: Sep 3, 2013 - ragebull
#
# Usage:
#
# ex: powershell.exe ".\Check-WRETCH-CC.ps1"
#
# Note: 1. please update the $blogname with your blog name
# 2. this tool will export all links to current working directory under individual filenames
# 3. the image, hyperlink etc are not changed to point to local copy, therefore
# once the online image is gone due to site closure, html page will be missing image
#
#########################################################################

#requires -version 3.0

clear-host

$blogname = "YourBlogName"
$url = "http://www.wretch.cc/blog/" + $blogname + "&list=1"

$result = Invoke-WebRequest $url -UseDefaultCredentials
$SearchToken = "http://www.wretch.cc/blog/" + $blogname + "*"

$BlogLinks = $result.links | where href -Like $SearchToken | select innerText, href

$url = $null

foreach ($_ in $BlogLinks)
{
write-host "Checking blog:" $_.innertext:
$BlogDetailURL = $_.href

$BlogDetailPage = Invoke-WebRequest $BlogDetailURL -UseDefaultCredentials
$outputFileName = ".\" + $_.innertext + ".html"

$BlogDetailPage.Content | tee-object -filepath $outputFileName
}

本帖最近評分記錄
  • 呂ㄚ家 金錢 +5 讚!讚!讚! 2013-09-05 20:30

  • 大山 金錢 +3 大大…厲害…看無*-* 2013-09-05 00:33

  • 軍醫二級 金錢 +1 在後版看到小程式...果然是高手藏在巷子裡 2013-09-05 00:33

234師701旅步四營 餿排 ^^
(預官42期=1659T)

引用 TOP

後 備 軍 友 俱 樂 部   All Rights Reserved.

回上一頁

回頁首