<?xml version="1.0" encoding="utf-8" ?>
<ignite version="1.0" source="haveibeenpwned.com">

  <func name="breachedaccount" endpoint="https://haveibeenpwned.com/api/v2/breachedaccount/{email}" method="GET" format="JSON_ARRAY">
    <description>
      This function returns information from haveibeenpwned.com for a given email address. Because the server returns an array, the calling function includes the array Index.
    </description>
    <example>
      =Ignite("haveibeenpwned.com","breachedaccount","pwnCount", 0, "foo@bar.com").
    </example>
    <document>
      <![CDATA[
      <a class="doc" href="https://haveibeenpwned.com/API/v2">Documentation</a>
]]>
    </document>
    <inputs>
      <input name="email" type ="input1" process="replace"/>
      <input name="User-Agent" type="config" value="Pwnage-Checker-For-Excel-Ignite" method="HTTP_HEADER"/>
    </inputs>
    <outputs>
      <output name="title" path="Title"/>
      <output name="name" path="Name"/>
      <output name="domain" path="Domain"/>
      <output name="breachDate" path="BreachDate"/>
      <output name="pwnCount" path="PwnCount"/>
      <output name="description" path="Description"/>
      <output name="dataClasses" path="DataClasses"/>
      <output name="isSensitive" path="IsSensitive"/>
    </outputs>
  </func>

  <examples>
    <![CDATA[
<table border='1' class='ExcelTable2007'>
<tr><th class='heading'>&nbsp;</th><th>A</th><th>B (Forumla)</th><th>C (Output)</th></tr>
<tr><td class='heading' >1</td>
    <td width=120px>foo@bar.com</td>
    <td width=300px>=Ignite("haveibeenpwned.com","breachedaccount","title", 0, A1)</td>
    <td>000webhost</td>
</tr>
<tr><td class='heading' >2</td>
    <td>foo@bar.com</td>
    <td>=Ignite("haveibeenpwned.com","breachedaccount","name", 0, A2)</td>
    <td>000webhost</td>
</tr>
<tr><td class='heading' >3</td>
    <td>foo@bar.com</td>
    <td>=Ignite("haveibeenpwned.com","breachedaccount","domain", 0, A3)</td>
    <td>000webhost</td>
</tr>
<tr><td class='heading' >4</td>
    <td>foo@bar.com</td>
    <td>=Ignite("haveibeenpwned.com","breachedaccount","breachDate", 0, A4)</td>
    <td>2015-03-01</td>
</tr>
<tr><td class='heading' >5</td>
    <td>foo@bar.com</td>
    <td>=Ignite("haveibeenpwned.com","breachedaccount","pwnCount", 0, A5)</td>
    <td>13545468</td>
</tr>
<tr><td class='heading' >6</td>
    <td>foo@bar.com</td>
    <td>=Ignite("haveibeenpwned.com","breachedaccount","description", 0, A6)</td>
    <td>In approximately March 2015, the free web hosting provider <a href="http://www.troyhunt.com/2015/10/breaches-traders-plain-text-passwords.html" target="_blank">000webhost suffered a major data breach</a> that exposed over 13 million customer records. The data was sold and traded before 000webhost was alerted in October. The breach included names, email addresses and plain text passwords.</td>
</tr>
<tr><td class='heading' >7</td>
    <td>foo@bar.com</td>
    <td>=Ignite("haveibeenpwned.com","breachedaccount","dataClasses", 0, A7)</td>
    <td>["Email addresses","IP addresses","Names","Passwords"]</td>
</tr>
<tr><td class='heading' >8</td>
    <td>foo@bar.com</td>
    <td>=Ignite("haveibeenpwned.com","breachedaccount","isSensitive", 0, A8)</td>
    <td>False</td>
</tr>
</table>
      ]]>
  </examples>

</ignite>
