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 Profile photo of Dan Potter Dan Potter 3 months, 4 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40911
    Profile photo of Jon Ll
    Jon Ll
    Participant

    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
    Profile photo of Arie H
    Arie H
    Participant

    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

    https://www.script-tutorials.com/facebook-api-get-friends-list/

    • This reply was modified 3 months, 4 weeks ago by Profile photo of Arie H Arie H.
    #40923
    Profile photo of Jon Ll
    Jon Ll
    Participant

    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 }
    $result1.TotalMilliseconds
    }
    catch
    {

    $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
    Profile photo of Dan Potter
    Dan Potter
    Participant
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.