<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs
title="Wikipedia Picture of the Day"
title_url="http://opensocialdirectory.videgro.net/index.php?appid=6"
directory_title="Wikipedia Picture of the Day"
description="Every day a new Wikipedia Picture of the Day"
author="VIDEGRO"
author_link="http://opensocialdirectory.videgro.net/"
author_email="eurtopmodel@gmail.com"
screenshot="http://gadgets.videgro.net/images/gadgetWikipediaPotdScreenshot.png"
thumbnail="http://gadgets.videgro.net/images/gadgetWikipediaPotdThumbnail.png"
scaling="true"
render_inline="optional"
width="220"
height="343"
>
<Require feature="analytics" />
</ModulePrefs>
<Content type="html">
<![CDATA[

<style>
IMG {
        width:220px;
        border-width:0px;
}
</style>

<script src="http://www.google.com/jsapi" type="text/javascript"></script>

<script type="text/javascript">

        function onLoad() {
                var feed = new google.feeds.Feed("http://tools.wikimedia.de/~daniel/potd/commons/potd-400x300.rss");
    
                // Calling load sends the request off. It requires a callback function.
                feed.load(feedLoaded);
        }

        function feedLoaded(result) {
                if (!result.error) {                       
                        // Grab the container we will put the results into
                        var container = document.getElementById("content");
                        container.innerHTML = '';
    
                        // Check out the result object for a list of properties returned in each entry.
                        // http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON
                        var entry = result.feed.entries[0];
			var redirUrl=entry.link;
			console.log(entry);
			
			var imgUrl=entry.mediaGroups[0].contents[0].url;
			
                        container.innerHTML='<a href="'+redirUrl+'" target="_blank"><img src="'+imgUrl+'"/></a><br /><br /><p style="text-align:center; font-size:9px;">'+entry.title+'</p>';
                }
        }

	google.load("feeds", "1");
        _IG_Analytics("UA-383400-14", "/gadget_wikipediapotd_view");
        google.setOnLoadCallback(onLoad);
</script>

<div id="content" style="text-align: center;" width="220" height="273"></div>

<p><a style="text-align:center; font-size:11px;" href="http://opensocialdirectory.videgro.net" target="_new">[more gadgets]</a></p>
]]>
</Content>
</Module>

