Skip to content

Instantly share code, notes, and snippets.

@ezeeetm
Created March 12, 2016 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezeeetm/32c50f223e01cd56cf00 to your computer and use it in GitHub Desktop.
Save ezeeetm/32c50f223e01cd56cf00 to your computer and use it in GitHub Desktop.
scrapes stuff
$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