Fortune Cookie Service

Mar 26th, 2009 | By Christian Donner | Category: Free Software, Geek's Home

Cdonner.com is giving away free fortune cookies! In order to include a fortune cookie in your blog, paste the following script into your page content as HTML source:

<script type=”text/javascript” language=”javascript” src=”http://cdonner.kicks-ass.net:8080/FortuneCookie/CookieJS.aspx”></script>

You can customize the look by adding and editing these two styles to your template’s CSS stylesheet:

div.fortunecookie { font-family:Trebuchet MS; font-size:large; }
div.acknowledgement { font-family:Trebuchet MS; font-size:small; margin-top:15px;}

The Cookie Services is also available as a Web Service. You can browse the service definition at this URL.

POST /FortuneCookieWS/CookieSvc.asmx HTTP/1.1
Host: cdonner.kicks-ass.net
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetCookie xmlns="http://cdonner.kicks-ass.org/" />
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetCookieResponse xmlns="http://cdonner.kicks-ass.org/">
      <GetCookieResult>string</GetCookieResult>
    </GetCookieResponse>
  </soap12:Body>
</soap12:Envelope>

Tags: , , , ,

Leave Comment