OpenSocial

Example of using a xml file with your public wwws that are displayed on a Google map.

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Jouw publieke wiewatwaar op de kaart" summary="" description="" author="" author_email="" thumbnail="" screenshot="" height="260">
   <Require feature="opensocial-0.7"/>
   <Require feature="dynamic-height"/>
		<Optional feature="content-rewrite">
		  <Param name="include-urls">.*</Param>
		  <Param name="exclude-urls"></Param>
		  <Param name="include-tags">link,img,style</Param>
 
		</Optional>
 
</ModulePrefs>
<Content type="html">
     <![CDATA[
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAaUtu4ciH37L1dY4ocrVJ8BSr1uBYV4d3_BC2tRWTDZMuGQ27jhRN6dW304KEHCm8mckUZGi_-R-hZg" type="text/javascript"></script>
    <script type="text/javascript">
	//Clean up
	document.body.onunload = function() { GUnload(); };
	// key hyves-modules.nl = ABQIAAAAaUtu4ciH37L1dY4ocrVJ8BSr1uBYV4d3_BC2tRWTDZMuGQ27jhRN6dW304KEHCm8mckUZGi_-R-hZg
	var map;
	var geoXml;
 
    function loadMap(username) {
      if (GBrowserIsCompatible()) {
			geoXml = new GGeoXml("http://www.hyves-feeds.nl/rss/hyver/"+username+"/wiewatwaar/");
			map = new GMap2(document.getElementById("content"));
			map.setCenter(new GLatLng(52.255549,5.061951), 9);
			map.setUIToDefault();
			if(map.isLoaded()) {
				map.addOverlay(geoXml);
				gadgets.window.adjustHeight();
			}
      } else {
	  	document.getElementById("content").innerHTML = '<p>We&#0039;re sorry, but your browser doesn&#0039;t support the Google Maps API.</p>';
	  }
    }
 
	function loadData(req) {
		req.add(req.newFetchPersonRequest('OWNER'), 'owner');
		req.send(onLoadData);
	}
	function onLoadData(data) {
		var ownerdata = data.get('owner').getData();
		var owner = ownerdata.getField(opensocial.Person.Field.PROFILE_URL);
	    owner = owner.split(".");
	    owner = owner[0].substring(7)
		html = new Array();
		html.push(owner);
	    var username = html.join('')
		loadMap(username);
	}
 
	function init() {
		var req = opensocial.newDataRequest();
		loadData(req);
	}
 
	gadgets.util.registerOnLoadHandler(init);
 
    </script>
    <div id="content" width="100%" style="height:300px;"></div>
	]]>
</Content>
</Module>

Example install (Make sure you're not in OpenSocial Sandbox mode)

Example file

To pass to a gadget on install. You can add params to the GadgetGallery itempage (this doesn't work on Data-API installs). You can install the gadget below by using the following url for installation: ?appParams={"data1":"exampledata1","data2":"exampledata2"}.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Passing params to another view" description="" screenshot="" author="" author_email="" author_location="" author_affiliation="" height="200">
<Require feature="opensocial-0.7" />
<Require feature="views" />
</ModulePrefs>
  <Content type="html">
  <![CDATA[
<script type="text/javascript">
function navigate(navigateview){
	var params = {};
	var currentview = gadgets.views.getCurrentView().getName();
	var availableviews = gadgets.views.getSupportedViews();
	for(i in availableviews) {
		// show all possible views with the firebug add on in Firefox
		if (window.console && window.console.firebug) {		
			console.log(availableviews[i]);
		}
	}
	if(currentview != navigateview && navigateview != '') {
		params['data1'] = 'This is paramdata';
		params['data2'] = 'This is paramdata to';
		gadgets.views.requestNavigateTo(availableviews[navigateview], params);
	} else {
		alert('You are allready on this view');
	}
}
function init() {
	var params = gadgets.views.getParams();
	if (typeof(params['data1']) == 'undefined') document.getElementById('sParam1').value = 'empty'; else document.getElementById('sParam1').value = params['data1'];
	if (typeof(params['data2']) == 'undefined') document.getElementById('sParam2').value = 'empty'; else document.getElementById('sParam2').value = params['data2'];	
}
 
gadgets.util.registerOnLoadHandler(init);
</script>
Which view do you want to go to? <select onChange="javascript:navigate(this.value);">
    <option>select...</option>
    <option value="profile">profile</option>
    <option value="canvas">canvas</option>
</select>
<br><br>
Passed param value: <input type="text" id="sParam1" style="background:#F0F0F0;" READONLY /><br>
Passed param value: <input type="text" id="sParam2" style="background:#F0F0F0;" READONLY /><br>
  ]]>
  </Content>
</Module>

Note: If you want to use this as a way to personalise your gadget you'll need to store the appParams as appData to ensure that this data is not lost after the initial installation. More information on appData can be found here.

Example install (Make sure you're not in OpenSocial Sandbox mode)

Example file

Create messages that will appear to the user within the gadget.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="MiniMessage example" height="200" scrolling="true" author_email="gorillaapi@gmail.com" screenshot="http://www.apikooien.nl/examples/opensocial/images/thumbnail.jpg" thumbnail="http://www.apikooien.nl/examples/opensocial/images/thumbnail.jpg">
	<Require feature="opensocial-0.7"/>
	<Require feature="views"/>
	<Require feature="dynamic-height"/>
	<Require feature="minimessage" />
	<Locale lang="nl"/>
</ModulePrefs>
<Content type="html">
    <![CDATA[
	<script type="text/javascript">
		function createDismissibleMessage(){
			var msg = new gadgets.MiniMessage();
			msg.createDismissibleMessage('This is a DismissibleMessage');
		}
		function createStaticMessage(){
			var msg = new gadgets.MiniMessage();
			msg.createStaticMessage('This is a StaticMessage');
		}
		function createTimerMessage(){
			var msg = new gadgets.MiniMessage();
			msg.createTimerMessage('This is a TimerMessage, set to 3 seconds',3);
		}
	</script>
	<input type="button" value="Set Dismissible Message" onClick="createDismissibleMessage();">&nbsp;&nbsp;&nbsp;<input type="button" value="Set Static Message" onClick="createStaticMessage();">&nbsp;&nbsp;&nbsp;<input type="button" value="Set Timer Message" onClick="createTimerMessage();">
	]]>
</Content>
</Module>

Example install (Make sure you're not in OpenSocial Sandbox mode)

Example file

Place a button inside the gadget where the user can install the gadget on his own profile.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Check Viewer permission" summary="" description="" author="" author_email="" thumbnail="" screenshot="" height="380">
  <Require feature="opensocial-0.7"/>
</ModulePrefs>
<Content type="html">
  <![CDATA[
  <div id='content'></div>
  <br>
  <script type="text/javascript"> 
  var InstallRequest = function() {
    opensocial.requestInstallApp;
  }
  </script>
  <input type="button" value="install gadget" onClick="InstallRequest();">
  ]]>
</Content>
</Module>

Example install (Make sure you're not in OpenSocial Sandbox mode)

Example file

For the third year in a row, Hyves together with the department Mediatechnology of the Hogeschool Rotterdam held a project for first year students in which the students had 4 months to come up with an original concept for a Hyves Gadget, but also to translate that concept into a working prototype. Just like the previous two years, the students were asked to come the the Hyves Headquarters in Amsterdam to show their final results.

On Thursday the 21st of April, the 14 prototypes were presented at the Hyves HQ in Amsterdam by some 50 students. An impression of the event can be found here.

Honorable mentions

image
Something out of pixels
Something out of pixels is a collaborative drawing tool which allows Hyvers to create a drawing with a group of friends. Each friend gets the opportunity to add 50 pixels to the drawing. The idea behind the gadget is to create a social, creative experience for the Hyver.
Gadget: http://project.cmi.hro.nl/2010_2011/mt_hyves_t1/Hyves/get_flash.xml (Only in Sandbox mode)
Paperfight
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In bibendum, quam eget condimentum adipiscing, leo turpis fermentum risus, sed eleifend sem diam nec tellus. Morbi vestibulum sagittis ipsum. Cras id enim arcu. Donec ac erat eget mi viverra sollicitudin.
Gadget: http://www.hyves.nl/gadgetgallery/1468/Paperfight/
Website: http://www.paperfight.nl/
Fill me in
Fill me in offers the Hyver a functionality which has been missing from Hyves: Questionnaires. After installing this gadget you can create and shar your own questionnaires with your friends. This has been a popular activity for a big group of Hyvers but up untill now this meant that the Hyver had to create his own questionnaire and people had to copy-paste this list to anwer the questions. Fill me in does all this work for the Hyver making it really easy to create and share a questionnaire.

All gadgets

Team 1: Something out of pixels
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t1/wordpress/
Site: http://project.cmi.hro.nl/2010_2011/mt_hyves_t1/site/
Team 2: Dare 2 Tell
Gadget gallery: http://www.hyves.nl/gadgetgallery/1469/Dare2Tell/
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t2/
Site: http://project.cmi.hro.nl/2010_2011/mt_hyves_t2/dare2tell/
Team 3: The Social Factor
Gadget gallery: http://www.hyves.nl/gadgetgallery/1470/The_Social_Factor/
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t3/blog/blog
Site: http://www.social-factor.com
Team 4: HyFight
Gadget gallery: http://www.hyves.nl/gadgetgallery/1476/HyFight/
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t4/
Team 5: Paperfight
Gadget gallery: http://www.hyves.nl/gadgetgallery/1468/Paperfight/
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t5/
Site: http://www.paperfight.nl/
Team 7: Mijnveger
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t7/
Team 8: RockBlender
Gadget gallery: http://hyves.nl/gadgetgallery/1477/Rockblender/
Blog: http://rockblender.wordpress.com/
Site: http://project.cmi.hro.nl/2010_2011/mt_hyves_t8/
Team 9: DrankjesGadget
Gaget gallery: http://hyves.nl/gadgetgallery/1478/Drankjes_Gadget/
Blog: http://drankjesgadget.nl/blog/
Site: http://drankjesgadget.nl/
Hyve: http://drankjesgadget.hyves.nl/
Team 10: CityDefender
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t10/
Site: http://project.cmi.hro.nl/2010_2011/mt_hyves_t10/site/
Team 11: Flirt
Gadget gallery: http://www.hyves.nl/gadgetgallery/1481/FLIRT/
Blog: http://teamflirt.wordpress.com/
Site: http://project.cmi.hro.nl/2010_2011/mt_hyves_t11/FLIRT%20website/
Team 12: Comet Escape
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t12/
Site: http://project.cmi.hro.nl/2010_2011/mt_hyves_t12/website/
Team 13: Fill me In
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t13/
Team 14: Dare This
Gadget gallery: http://www.hyves.nl/gadgetgallery/1479/0/
Blog: http://project.cmi.hro.nl/2010_2011/mt_hyves_t14/site/blog.php
Site: http://project.cmi.hro.nl/2010_2011/mt_hyves_t14/site/gadget.html

Jonge Leeuwen is an initiative for young soccer enthusiasts between the ages of 6 and 12 from ING, Hyves and the KNVB (The Dutch national soccer association) and is created by Lab1111. They use Hyves to

- Enable users to login in with their Hyves account
- Push content to friends on Hyves

On the platform young soccer enthusiasts can play games, watch videos and follow instructions from coaches to improve their own skills. Since the ING and KNVB are actively involved, the boys and girls will have an insider’s view into the daily life of the players and coaches of the Dutch national soccer team.

For login on the platform, Lab1111 choose to use our OpenID integration to offer the visitors a simple and fast registration flow. This means that the visitors do not have to fill in a form with all their personal information, but they can simply click the “Login with Hyves” button which registers them and will sign them in automatically.
Next to the OpenID integration, Lab1111 also integrated our Data-API to enable their visitors to share content such as videos, high scores and status updates with their friends on Hyves.

In the first week, 80% of the traffic to JongeLeeuwen.nl was generated by content shared on Hyves, which indicates the viral effect the sharing of content can achieve.

http://www.jongeleeuwen.nl

Techniques: Data API, OpenID, OpenSocial Tags: Login, WWW, Pimp, Profiel

Hi Guys,

This Thursday (6/1/11) we will migrate the servers on which the appData for OpenSocial is stored. During this migration the availability of appData will be limited for a period of 2 to 3 hours.

After the migration all appData on the Live environment will be available again, but all the appData which has been stored in the Sandbox will be lost.

If you have any questions or if you run into issues, please leave a comment below or email us at hyves-api[at]hyves.nl

Regards,
Hyves-API team

You can use a combination of appParams and appData to create a personalized gadget.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Passing and storing paramaters on install" summary="" description="" author="" author_email="" thumbnail="" screenshot="" height="380">
<Require feature="opensocial-0.7"/>
<Require feature="views" />
</ModulePrefs>
 
	<Content type="html">
  	<![CDATA[
 
	<style>
	html, body {
		margin: 0; /* set the iframed page margin to zero */
		padding: 10px;
	}
	</style>
 
	<div id="content"></div>
 
    <script type="text/javascript">
 
 
	function init() {
		var req = opensocial.newDataRequest();
		req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER), "oOwner");
		req.add(req.newFetchPersonAppDataRequest("OWNER", "myKey"), "get_data");
		req.send(get_callback);
	}
 
	function get_callback(response) {
		var userid = response.get("oOwner").getData().getId();
		var data = response.get("get_data").getData();
		var myKey = data[userid]["myKey"];
 
		if (myKey != null) {
			var html = "<h3>appParams already stored</h3>";
			html += "<p>You've already succesfully stored the appParams on installation. Currently the params that are stored for this gadget is: <strong>" +myKey+ "</strong></p>";
			// Create HTML
			document.getElementById("content").innerHTML = html;
 
		} else {
			var appParams = gadgets.views.getParams();
			var installParam = appParams['data1'];
			var req = opensocial.newDataRequest();
			req.add(req.newUpdatePersonAppDataRequest("VIEWER", "myKey", installParam), "set_data");
			req.send(set_callback);
		}
	}
 
	// Check if the username has been set
	function set_callback(response) {
		if (response.get("set_data").hadError()) {
			alert("set callback failed: "+response.get("set_data").getErrorMessage());
		} else {
			var html = "<h3>Succesfully stored appParams!</h3>";
			html += "<p>You can now use them to personalize your gadget.</p>";
			// Create HTML
			document.getElementById("content").innerHTML = html;
		}
	}
 
	gadgets.util.registerOnLoadHandler(init);
 
	</script>
  	]]>
	</Content>
</Module>

Example install (Make sure you're not in OpenSocial Sandbox mode)

Example file

You can now request support for communication between your gadget and the Buzz (activity feed on the Hyves homepage and a small feed on the users profile). This means your gadget can send updates on gadget activities to friends. For example activities that include game progress or achievements earned in a game. These Activity posts are always user initiated.

How can I use this function? You need to request this functionality when you have a "live" gadget (not only in sandbox). More information can be found on http://www.hyves-developers.nl/documentation/opensocial/activity-post.