PoshCode Archive  Artifact [5ed31a02eb]

Artifact 5ed31a02eb363d1d9d811b58916048ab8eac8194283fac15b69532e3f7baa395:

  • File Get-DominosOrderStatus.ps1 — part of check-in [bc70d8e0a6] at 2018-06-10 12:56:56 on branch trunk — Gets the status of your Dominos pizza order. Your phone number is the only input parameter. This is the most important Psh module you’ll ever import. (user: xcud size: 1092)

# encoding: ascii
# api: powershell
# title: Get-DominosOrderStatus
# description: Gets the status of your Dominos pizza order. Your phone number is the only input parameter. This is the most important Psh module you’ll ever import.
# version: 0.1
# type: script
# author: xcud
# license: CC0
# function: Get-DominosOrderStatus
# x-poshcode-id: 1355
# x-archived: 2014-08-30T04:21:29
# x-published: 2010-09-30T12:51:00
#
#
# Get-DominosOrderStatus.psm1
# Author:       xcud.com
#
# Inspired by Dana Merrick's Dominos Pizza Script
# http://shakti.trincoll.edu/~dmerrick/dominos.html

function Get-DominosOrderStatus($phone_number) {
	$url = "http://trkweb.dominos.com/orderstorage/GetTrackerData?Phone=$phone_number"
	[xml]$content = (new-object System.Net.WebClient).DownloadString($url);
	$statii = select-xml -xml @($content) `
			   -Namespace @{dominos="http://www.dominos.com/message/"} `
			   -XPath descendant::dominos:OrderStatus
	if($statii.Count -gt 0) { $statii | %{ $_.Node } }
	else { "No orders" }
}

Export-ModuleMember Get-DominosOrderStatus