How can i make a script to report/show when changes are made to a webpage

This topic contains 3 replies, has 3 voices, and was last updated by  Dan Potter 1 year, 9 months ago.

  • Author
  • #40911

    Jon Ll

    How would i make a script in powershell to see who unfriends me in facebook. would i use a webcrawler. i was given a bonus assignment for school. and i thought a web crawler would be the way to go. i do under stand html/css and some javascript but im new to powershell and not sure where to start. or maybe a webcrawler to report/show changes and have the report shown in a csv or something not sure any help is handy thanks

  • #40920

    Arie H

    Though you can try to do this with PowerShell, it wasn't created for this task.

    Was PowerShell part of the assignment ?

    PHP or C# with the facebook API might be a better tool for the job

    • This reply was modified 1 year, 9 months ago by  Arie H.
  • #40923

    Jon Ll

    yes it need to be done in powershell i found this code

    ## The URI list to test
    $URLListFile = "C:\url.txt"
    $URLList = Get-Content $URLListFile -ErrorAction SilentlyContinue
    $Result = @()

    Foreach($Uri in $URLList) {
    $time = try{
    $request = $null
    ## Request the URI, and measure how long the response took.
    $result1 = Measure-Command { $request = Invoke-WebRequest -Uri $uri }

    $request = $_.Exception.Response
    $time = -1
    $result += [PSCustomObject] @{
    Time = Get-Date;
    Uri = $uri;
    StatusCode = [int] $request.StatusCode;
    StatusDescription = $request.StatusDescription;
    ResponseLength = $request.RawContentLength;
    TimeTaken = $time;

    #Prepare email body in HTML format
    if($result -ne $null)
    $Outputreport = "Website Availability Report Website Availability Report URLStatusCodeStatusDescriptionResponseLengthTimeTaken

  • #40986

    Dan Potter

You must be logged in to reply to this topic.