Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:Vitamen/surveyApp

  • Loading branch information...
commit a3f02f587a06e9b41dc99ff4b6cd9058c80c5f18 2 parents d819e32 + 103625e
@sophaz sophaz authored
View
7 app/controllers/Application.java
@@ -20,7 +20,7 @@
public static void index() {
- //generateFeeds();
+ generateFeeds();
String currentUser = Session.current().get("user");
User user = User.find("byUserId", currentUser).first();
if (user != null) {
@@ -39,8 +39,9 @@ public static boolean getUserLikes(){
try {
String userId = user.userId;
StringBuffer queryPart = new StringBuffer(userId+"/likes");
- JsonArray userLikes = FbGraph.getConnection(queryPart.toString(), Parameter.with("limit", "1000").parameters());
-
+
+ JsonArray userLikes = FbGraph.getConnection(queryPart.toString(), Parameter.with("access_token", "BAAFTZB1ThIZBQBACYExOvxBc569YgOr8YtjiETSbq8BkG6wnqegV2U8wCrEZBihZAGsU2h2wZBogtwTOAH5ZAb8QMY6qi6sHhviEHWHpIWjCxFFpHEdq0XOegD3LCNI4KMqrqwcjmCEwZDZD").parameters());
+ System.out.println("User LIkes JSON Array size"+userLikes.size());
user.addAllLikes(userLikes);
} catch (FbGraphException e) {
e.printStackTrace();
View
3  app/controllers/RecommendationEngine.java
@@ -218,15 +218,18 @@ public static Topic fetchTopicForUser(User user, int seed) {
}
if (user != null) {
+ System.out.println("Got a user :"+user);
if (user.frequencyOfLikes == null || user.frequencyOfLikes.size() == 0) {
System.out.println("ERROR: This should not happen");
}
List<LikeFrequency> likeFrequencies = user.frequencyOfLikes;
Collections.sort(likeFrequencies, new LikeFrequencyComparator());
LikeFrequency lf;
+ System.out.println("Found "+likeFrequencies.size()+" Likes");
if (likeFrequencies.size() > seed) {
lf = likeFrequencies.get(seed);
tag = LikeGroup.getLikeGroupFromCategory(lf.likeCategory);
+ System.out.println("Setting tag to "+tag);
}
} else {
System.out.println("ERROR: Could not find user in session.");
View
71 app/views/Application/index.html
@@ -3,30 +3,51 @@
#{fbg.scriptAsync /}
<div class="container">
- Thank you for taking our survey. Your information will be kept confidential.
- <div class="span2">
- <div class="fb-login-button" onlogin="facebookLogin();" scope="
- user_about_me, user_activities, user_birthday, user_checkins, user_education_history, user_events, user_groups, user_hometown
- user_interests, user_likes, user_relationships, user_relationship_details, user_relationship_details, user_religion_politics, user_work_history
- friends_about_me, friends_activities, friends_birthday, friends_checkins, friends_education_history, friends_events, friends_groups,
- friends_hometown, friends_interests, friends_likes, friends_relationships, friends_relationship_details, friends_religion_politics, friends_work_history">
-
- Login with Facebook</div>
-
-
- <script type="text/javascript">
- function facebookLogin() {
- // get current login status from facebook.com
- FB.getLoginStatus(function(response) {
- if (response.status === 'connected') {
- // the user is logged in and connected to your app
- window.location = "@{Application.facebookLogin()}";
- } else {
- window.location = "@{Application.facebookLogout()}";
- }
- });
- }
- </script>
- <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/main.css'}" />
+ <div class="leftContainerMain">
+ <p class="paddingOnTop">
+ Conversationalist is an iPhone application which helps people have conversations with people
+ they may not know as well. This is done by generating user related RSS feeds based on
+ their <b>online social footprint</b>.
+ <br/>
+ <br/>
+ To ensure the highest level of user experience, we need to ensure that our recommendation
+ engine for articles provides an good articles for users to use during their conversation.
+ <br/>
+ <br/>
+ This is the purpose of the analysis engine. We hope to fine-tune our algorithm by keeping track
+ what you as users would choose as a potential conversation topic. All data will be completely
+ anonymized and we are not storing any of your Facebook information.
+ <br/>
+ <br/>
+ Thank you for contributing to our research.
+ </p>
+ <div class="span2">
+ <div class="fb-login-button" onlogin="facebookLogin();" scope="
+ user_about_me, user_activities, user_birthday, user_checkins, user_education_history, user_events, user_groups, user_hometown
+ user_interests, user_likes, user_relationships, user_relationship_details, user_relationship_details, user_religion_politics, user_work_history
+ friends_about_me, friends_activities, friends_birthday, friends_checkins, friends_education_history, friends_events, friends_groups,
+ friends_hometown, friends_interests, friends_likes, friends_relationships, friends_relationship_details, friends_religion_politics, friends_work_history">
+
+ Login
+
+ </div>
+ </div>
+ <script type="text/javascript">
+ function facebookLogin() {
+ // get current login status from facebook.com
+ FB.getLoginStatus(function(response) {
+ if (response.status === 'connected') {
+ // the user is logged in and connected to your app
+ window.location = "@{Application.facebookLogin()}";
+ } else {
+ window.location = "@{Application.facebookLogout()}";
+ }
+ });
+ }
+ </script>
+ </div>
+ <div class="rightContainerMain">
+ <img src="@{'public/images/iPhoneImages.png'}"/>
+ </div>
</div>
View
4 app/views/main.html
@@ -13,7 +13,9 @@
</head>
<body>
<div class = "container">
- <h1>Conversationalist</h1>
+ <div class="imageTag">
+ <img src="@{'public/images/icon_middle.png'}"/>
+ </div>
</div>
<hr/>
#{doLayout /}
View
4 conf/application.conf
@@ -223,8 +223,8 @@ fbg.appId= 373813902648292
fbg.appSecret = afe834d3ab9df8c8cefd887d394d9100
# MyApp
-# fbg.appId=241182249302565
-# fbg.appSecret=88a5e45ac15edc0c88036dd84c2f6196
+fbg.appId=241182249302565
+fbg.appSecret=88a5e45ac15edc0c88036dd84c2f6196
#Sophie's App
#fbg.appId=248469798569464
View
BIN  public/images/iPhoneImages.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/icon_middle.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
18 public/stylesheets/bootstrap/css/bootstrap.css
@@ -19,6 +19,24 @@ nav,
section {
display: block;
}
+.imageTag{
+ margin-top:20px;
+ width:500px;
+}
+.leftContainerMain{
+ width:400px;
+ float:left;
+}
+
+.rightContainerMain{
+ width = 400px;
+ float:right;
+}
+.paddingOnTop{
+ padding-top: 30px;
+}
+
+
audio, canvas, video {
display: inline-block;
*display: inline;
View
1  public/stylesheets/main.css
@@ -1,3 +1,4 @@
+
* {
font-family: Georgia, "Times New Roman";
width:100%;
Please sign in to comment.
Something went wrong with that request. Please try again.