Template:Cheeky Quote Code

From OpenSocial Directory

Jump to: navigation, search
<?xml version="1.0" encoding="UTF-8"?>
<Module>
  <ModulePrefs title="Cheeky Quote"
               title_url="http://madpuffininc.googlepages.com/cheekyquote-add.htm"
               description="Get fresh irreverent humor every day with Cheeky Quote ... displays a random funny quote every half hour. You can check out more humour, jokes, and things to ponder via the 'author quotes' and 'random quotes' links."
               thumbnail="http://hosting.gmodules.com/ig/gadgets/file/112764733758979090903/cheekyquote-thumbnail.png"
               screenshot="http://hosting.gmodules.com/ig/gadgets/file/112764733758979090903/cheekyquote-screenshot.png"
               directory_title="Cheeky Quote"
               category="lifestyle"
               category2="communication"
               width="320"
               height="200"
               scrolling="true"
               author="madpuffin"
               author_email="mad.puffin@yahoo.com"
               author_photo="http://hosting.gmodules.com/ig/gadgets/file/112764733758979090903/madpuffin.png"
               author_aboutme="I have one speed and this is it."
               author_quote="We're lost, but we're making great time! (Yogi Berra)">
    <Require feature="analytics" />
  </ModulePrefs>
  <Content type="html">
    <![CDATA[
<div id="cheekyquote_content"></div>
<script type="text/javascript">

function update(response)
{
  var regex = new RegExp("src=[\"'](.*?)[\"']", "g");

  var match;
  
  // use an associative array to eliminate duplicate image filenames
  var images = new Array();
  
  while ((match = regex.exec(response)) != null)
  {
    if (match.length > 1)
    {
      images[match[1]] = null;
    }
  }

  var cachedResponse = response;

  for (var image in images)
  {
    cachedResponse = cachedResponse.replace(image, _IG_GetCachedUrl(image));
  }

  _gel("cheekyquote_content").innerHTML = cachedResponse;
}

// Fetch fresh content every half hour
_IG_FetchContent("http://74.220.207.193/~lassytou/madpuffin/orkut/applications/cheekyquote/update.php", update, { refreshInterval: (60 * 30) });

// Track this gadget using Google Analytics.
_IG_Analytics("UA-3354729-1", "/cheekyquote");

</script>
]]>
  </Content>
</Module>
Personal tools
communication