Social networking links

Is current?: 
Yes

This page will cover ways to integrate social media into your studies.  Right now the example will cover how to add a Facebook link with IAT feedback and a twitter link.  These are only recommended to be used on the final debriefing page, to avoid social network effects.  A sample demo task debriefing 2 is included below.

First off, make sure that your file is a .jsp, renaming the .html to .jsp if you need to.  Include the following at the top of the file:

<%@page import="java.util.*,java.net.*, org.uva.*" errorPage="/research/ShowError.jsp"%>

 <%
StudySession mysession = (StudySession) session.getAttribute("studysession");
String feedback=" ";
String link=" ";
if (mysession!=null) {
feedback= (String) mysession.getAllResults("feedback").get(0);
link= "app_id=274607599229217&link=https://implicit.harvard.edu/implicit/&picture=https://implicit.harvard.... Implicit&caption=Asian  IAT&description="+feedback+"&message="+feedback+"&redirect_uri=https://implicit.harvard.edu/implicit/";
URI uri = new URI("http","www.facebook.com","/dialog/feed",link,null);
URL url = uri.toURL();
link=uri.toString();
}
%>

This will get the feedback results and display it in the Facebook wall post that the user will make.  If you don't want to show the feedback you just change the:

feedback= (String) mysession.getAllResults("feedback").get(0);

line to something else, such as:

feedback= "NOSEK IZ IN MAH MINDZ";

Then, wherever you want the Facebook button to appear, insert:

<a href="<%=link%>" onclick="window.open('<%=link%>','popup','width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=50,top=0'); return false"><img src="/implicit/common//all/img/facebook_icon.png" alt="Post to Facebook" width="32" height="32" /></a>

For twitter, it is even easier.  Just put the following code wherever you want the twitter button to be.

 <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://implicit.harvard.edu/implicit/" data-text="I did a 'SOMETHING - SOMETHING ELSE' IAT at Project Implicit." data-count="none">Share your results</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script></a>

The debriefing file below has an example of using both buttons together, in a good location.

If you are copying the twitter and Facebook links from it into another debrief, not that you need the <tr colspan="2"> on the main debriefing tr to preserve the formatting.