PowerShell your world cup

June 17, 2013

Table of Contents

PowerShell This is something that is very exciting and if you are interested you should try it. I found the post and tried it. Here is a function and how you use them.

  • Go to the kimono website and sign up for an account(http: //www.kimonolabs.com/signup)

This will get you an APIKey. Click your name once after you have logged in and then select your account.

  • Copy the API key and paste it below in the script and enjoy!

The Functions

$global:APIkey = “YOUR-KEY-GOES-HERE-FROM-STEP-2”

 

Function Get-WorldCupPlayer ($Country) {

    If ($Country) {

        $TeamID = (Get-WorldCupTeam -Country $Country).id

        Invoke-WebRequest -Uri (“http://worldcup.kimonolabs.com/api/players?teamId=$($TeamID)&apikey=$($ApiKey)”) | ConvertFrom-Json

    } Else {

        Invoke-WebRequest -Uri “http://worldcup.kimonolabs.com/api/players?apikey=$($ApiKey)” | ConvertFrom-Json

    }

}

Function Get-WorldCupTeam ($Country, $TeamID) {

    If ($Country) {

        Invoke-WebRequest -Uri (“http://worldcup.kimonolabs.com/api/teams?name=$($Country)&apikey=$($ApiKey)”) | ConvertFrom-Json

    }

    If ($TeamID) {

        Invoke-WebRequest -Uri (“http://worldcup.kimonolabs.com/api/teams?id=$($TeamID)&apikey=$($ApiKey)”) | ConvertFrom-Json

    }

 

    If (!$country -and !$TeamID) {

        Invoke-WebRequest -Uri “http://worldcup.kimonolabs.com/api/teams?apikey=$($ApiKey)” | ConvertFrom-Json

    }

}

Function Get-WorldCupStat {

    Invoke-WebRequest -Uri (“http://worldcup.kimonolabs.com/api/teams?sort=goalsFor,-1&apikey=$($ApiKey)”) | ConvertFrom-Json

}

Bring on the World Cup Fun

#Display the best team in the World Cup

Get-WorldCupTeam -Country “England”

Get-WorldCupStat | Format-Table

Get-WorldCupPlayer | Format-Table

Get-WorldCupPlayer -Country “England” | Format-Table

#Who has scored the most goals in the Netherland team so far?

Get-WorldCupPlayer -Country “Netherlands” | Foreach { $_ | Where

{ $_.goals -gt 0 } | Select firstName, lastName, goals } | sort goals –

Descending

#View the Logo of the team who is going to win

$logo = (New-Object System.Net.WebClient).DownloadFile(((Get-WorldCupTeam -Country “England”).logo), ($env:TEMP + “Logo.png”))

Invoke-Item $env:TEMPLogo.png

Home

Share on
Facebook
Twitter
LinkedIn
Pinterest
More posts

Dedicated Servers Quick Guide

What is a Dedicated Servers? Why bother using a dedicated server over a VPS or Shared Hosting?A dedicated server is a server 100% dedicated to your website/project or business needs.

Organizing Your Slim Based Project

A Slim Based Project is basically extended over three main directories. Slim framework directory Project directory This directory contains your project files like routers, views, models. Being a microframework, Slim

UPLOADING vmS TO VcLOUD WITH OVFtool

VMware’s OVFtool is a command line tool that allows you to convert VMware Virtual machines to Open virtualization Format (OVF). There have been some update in the latest version that

vSphere 5.1 New Storage Features

VMFS File Sharing Limits In previous versions of vSphere, the maximum number of hosts which could share a read-only file on a VMFS volume was 8. The primary use case

Add vCloud Harddisks with PowerCLI

Add vCloud Harddisks with PowerCLI When it comes to adding new disks to a VM,it is a little tough and you must be careful due to the many implementation of

Dedicated SERVER Special
50% OFF for Life!

🔥 DELL Bare-metal Dedicated Server in New York

🔹  Intel Gold 80 Cores
🔹  23TB SSD Flash +
🔹1TB NVMe (W RAID)
🔹 1TB DDR4 RAM 
🔹 10Gbps Redundant Uplinks 
🔹 10 IPv4 + IPv6 Addresses Included 

💲 Just $699/month – 50% OFF FOR LIFE! (Reg $1399/month)
🚀 Zero Setup Costs | Flexible OS: Ubuntu, Proxmox, ESXi, Windows, etc.

✅ Reserve Risk-Free! 30-Day Money-Back Guarantee
💡 100% Uptime Assurance – Enterprise-Grade Hardware 

🖥 Ideal for Virtualization, Data-Intensive Apps, & High Traffic Sites

Use coupon code at checkout for the discount to apply FBHEO3023EJFB
⚡ Limited Availability – Don’t Miss Out!

Get 90% Discount

First 3 People gets the Bonus!
Don't Miss Out Our Big Sale

Get 0-90% On All
247Rack Services

247Rack

The Sale Is Until The End Of March