Created
March 12, 2016 03:39
-
-
Save ezeeetm/32c50f223e01cd56cf00 to your computer and use it in GitHub Desktop.
scrapes stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$locations = @( | |
@('3747','Plaza One'), | |
@('3743','Plaza Three') | |
) | |
$restaurants = @( | |
'Claddagh''s Irish Pub', | |
'Mikey''s Late Night Slice', | |
'Greek Street', | |
'Phy Pho Phom', | |
'Mark Pi', | |
'Qdoba', | |
'Lemon Grass' | |
) | |
$msg = "" | |
$today = get-date -Format "dddd,MMMM dd,yyyy" | |
clear | |
foreach ($location in $locations) | |
{ | |
$locationId = $location[0] | |
$locationName = $location[1] | |
$resp = Invoke-WebRequest "http://www.aramarkcafe.com/layouts/canary_2010/locationhome.aspx?locationid=$locationId" | |
$todaysMenuUrl = "http://www.aramarkcafe.com/layouts/canary_2010/$(($resp.Links | where {$_.innerHTML -eq $today}).href)".Replace("&","&") | |
$resp = (Invoke-WebRequest $todaysMenuUrl).content | |
$msg += "$($locationName):`n" | |
foreach ($restaurant in $restaurants) | |
{ | |
if ($resp.contains($restaurant)) | |
{ | |
$msg += " $restaurant`n" | |
} | |
} | |
$msg += "`n" | |
} | |
$msg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment