Home Page › Forums › Free Resources › PowerShell script to download your ZoneGFX History
- This topic has 2 replies, 2 voices, and was last updated 7 years ago by Morri.
-
AuthorPosts
-
January 17, 2018 at 7:25 am #462700
PowerShell script to download your ZoneGFX History
I noticed I was re-downloading a lot of items over and over. So I wrote this to pipe points history out to an html file based on username, which you can then search for the product name to see if you already downloaded it. I had 150 pages to click through to find items, and that was getting really old. It'll open the previous output prior to run, if the path is present and valid. Enter your ZoneGFX username and hit enter twice.hint:
(Update the $pathForHTMLFile to a location you want to save to)note: code doesn't show up that great here, so here is a link to it in my mega
ZoneGFX-Tracking.ps1$TotalPages = 1
$username = read-host "your @username on the Zone:"
$pathForHTMLFile="X:\DAZ3D-CONTENT\zonegfxhistory.html"
if(test-path $pathForHTMLFile){start $pathforHtmlFile}else{Write-host "No Previous File, so this is either your first run, or you need to update the $pathForHTMLFile variable"}read-host "Press Enter to Begin"
$TotalPages = 1
$username = read-host "your @username on the Zone:"
$pathForHTMLFile="X:\DAZ3D-CONTENT\zonegfxhistory.html"
if(test-path $pathForHTMLFile){start $pathforHtmlFile}else{Write-host "No Previous File, so this is either your first run, or you need to update the $pathForHTMLFile variable"}read-host "Press Enter to Begin"
$URL="https://zonegfx.com/members/$username/mycred-history/"
$UrlData = Invoke-WebRequest $url
$xUrlData4TP=$UrlData.ToString().split("`n>")
$UrlDataArray=$UrlData.ToString().split("`n")<# Get Total Pages #>
FOREACH($L IN $xUrlData4TP)
{
$ErrorActionPreference = 'SilentlyContinue'
IF($PREV -EQ "1 of <span class='total-pages'")
{
$TotalPages = $L.SPLIT("<")[0]
Write-host "Total Pages to Scan: $TotalPages"
}
$PREV = $L
}
$c = @() #DataArrayObject<# Collect Data #>
foreach($line in $UrlDataArray)
{
if($line -like "*Purchase*")
{
$c+=$line.Replace("</tr>","</tr><br>").replace("</td>"," </td> ")
}
}$page=1
do{
$url="https://zonegfx.com/members/$username/mycred-history/?paged=$page"
write-host $url
$UrlData = Invoke-WebRequest $url
$UrlDataArray=$UrlData.ToString().split("`n")
foreach($line in $UrlDataArray)
{
if($line -like "*Purchase*")
{
$purchase = $line.Replace("</tr>","</tr><br>").replace("</td>"," </td> ")
$c+=$purchase
}
}
$page++
}until
($page -ge $TotalPages)# $c| clip <# Uncomment to send to clipboard #>
$c | Out-File $pathForHTMLFile
start $pathForHTMLFileJanuary 17, 2018 at 7:32 am #462706Results look like this: note, all the items in the results have links to the zonegfx page just like in points history. I only included in the first one.
January 17, 2018 1:19 am 25.00 Sale of Conforming Braces for Genesis 3
January 16, 2018 2:41 pm 100.00 Points for site visit
January 15, 2018 8:35 pm -50.00 Purchase of Momiji Trees Extreme Detail
January 15, 2018 8:33 pm -50.00 Purchase of Movie Sets, City Block 19
January 15, 2018 6:55 pm 10.00 Points for sending a message
January 17, 2018 7:14 am -50.00 Purchase of EJ Body Shape And Detail Morphs for Genesis 8 Female(s)
January 17, 2018 7:12 am -50.00 Purchase of HFS Sport Attitude for G2F
January 17, 2018 6:27 am 25.00 Sale of Cayley Character and Hair for Genesis 8 Female(s)
January 17, 2018 6:27 am 25.00 Sale of Cayley Clothing and Accessories
January 17, 2018 6:21 am -50.00 Purchase of Rodi Clean Cut Hair Style for Genesis 3 Male(s)
January 17, 2018 6:20 am -50.00 Purchase of Mec4D Unshaven 2 for Genesis 2 Male
January 17, 2018 6:20 am -50.00 Purchase of Whiskers for Genesis 3 Male(s)
January 17, 2018 6:18 am -50.00 Purchase of Thomas Hair for Genesis 3 Male(s)
January 17, 2018 6:18 am -50.00 Purchase of Adam Hair for Genesis 3 Male
January 17, 2018 6:18 am -50.00 Purchase of Bowl Cut Hair for Genesis 3 Male(s)
January 17, 2018 6:17 am -50.00 Purchase of Real Short Hair for Genesis 2 Male(s)
January 17, 2018 5:55 am 10.00 Points for sending a message
January 17, 2018 5:51 am 100.00 Points for site visitJanuary 17, 2018 at 9:56 am #462816There's only one major thing to remember that I discovered not that long ago. Your history isn't permanent. You only have 30 days to download an item after which point you have to pay for it again with points...
I discovered this when I went back to download some of my earlier stuff onto my new rig and found I was unable to.
-
AuthorPosts
- You must be logged in to reply to this topic.