PoshCode Logo PowerShell Code Repository

Get-DominosOrderStatus by xcudcom 29 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1355"></script>download | new post

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.

  1. # Get-DominosOrderStatus.psm1
  2. # Author:       xcud.com
  3. #
  4. # Inspired by Dana Merrick's Dominos Pizza Script
  5. # http://shakti.trincoll.edu/~dmerrick/dominos.html
  6.  
  7. function Get-DominosOrderStatus($phone_number) {
  8.         $url = "http://trkweb.dominos.com/orderstorage/GetTrackerData?Phone=$phone_number"
  9.         [xml]$content = (new-object System.Net.WebClient).DownloadString($url);
  10.         $statii = select-xml -xml @($content) `
  11.                            -Namespace @{dominos="http://www.dominos.com/message/"} `
  12.                            -XPath descendant::dominos:OrderStatus
  13.         if($statii.Count -gt 0) { $statii | %{ $_.Node } }
  14.         else { "No orders" }
  15. }
  16.  
  17. Export-ModuleMember Get-DominosOrderStatus

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me