From 56750aef7777c30bb62ad9a81dfbd9b05ee68c97 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sun, 1 Feb 2015 23:13:58 +0200 Subject: [PATCH] Bug #7 - Need to fetch Live feed from Aguda (via facebook) --- .gitignore | 1 + config.xml | 2 +- www/js/ApiService.js | 51 ++++++++++++++++++++++++----------- www/js/controllers.js | 12 +++++---- www/templates/aguda.html | 58 +++++++--------------------------------- www/templates/home.html | 2 +- 6 files changed, 54 insertions(+), 72 deletions(-) diff --git a/.gitignore b/.gitignore index 8f7ddd3..fa4936a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules/ platforms/ plugins/ +hooks/ diff --git a/config.xml b/config.xml index b2e398f..de6732f 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + jceMobile Free Your Academic Data diff --git a/www/js/ApiService.js b/www/js/ApiService.js index b134c41..aa47364 100644 --- a/www/js/ApiService.js +++ b/www/js/ApiService.js @@ -38,6 +38,7 @@ starter.factory('ApiService', ['$http', '$ionicPopup', '$ionicModal', function ( var password = window.localStorage['password']; var notes = window.localStorage['notes'] || null; var grades = window.localStorage['grades'] || null; + var agudaPosts = window.localStorage['agudaPosts'] || null; var request = "https://mipo.jce.ac.il/index.php/site/login?_dc=1419773997764&formValues=%7B%22form_fields%22%3A%7B%22name%22%3A%22"+username+"%22%2C%22pwd%22%3A%22"+password+"%22%7D%7D"; @@ -65,22 +66,40 @@ starter.factory('ApiService', ['$http', '$ionicPopup', '$ionicModal', function ( }); //Get Grades - $http.get("https://mipo.jce.ac.il/index.php/site/studentGrades").then(function(resp) { - console.log('Success', resp); - console.log("[JCE] [INFO] : in update - Got Grades!"); - if(grades === null){ - window.localStorage['newGrades'] = "true"; - window.localStorage['grades'] = JSON.stringify(resp.data); - }else if(grades === JSON.stringify(resp.data)){ - console.log("[JCE] [INFO] : in update - no new Grades"); - }else{ - window.localStorage['newGrades'] = "true"; - window.localStorage['grades'] = JSON.stringify(resp.data); - } - - }, function(err) { - console.error('[JCE] [INFO] : in update - can\'t get Grades', err); - }); + $http.get("https://mipo.jce.ac.il/index.php/site/studentGrades").then(function(resp) { + console.log('Success', resp); + console.log("[JCE] [INFO] : in update - Got Grades!"); + if(grades === null){ + window.localStorage['newGrades'] = "true"; + window.localStorage['grades'] = JSON.stringify(resp.data); + }else if(grades === JSON.stringify(resp.data)){ + console.log("[JCE] [INFO] : in update - no new Grades"); + }else{ + window.localStorage['newGrades'] = "true"; + window.localStorage['grades'] = JSON.stringify(resp.data); + } + + }, function(err) { + console.error('[JCE] [INFO] : in update - can\'t get Grades', err); + }); + + //Get Aguda Posts + $http.get("https://ajax.googleapis.com/ajax/services/feed/load?v=2.0&num=10&q=https://www.facebook.com/feeds/page.php?id=597726260353610%26format=rss20").then(function(resp) { + console.log('Success', resp); + console.log("[JCE] [INFO] : in update - Got Aguda from Facebook!"); + if(grades === null){ + window.localStorage['newAguda'] = "true"; + window.localStorage['newAguda'] = JSON.stringify(resp.data); + }else if(grades === JSON.stringify(resp.data)){ + console.log("[JCE] [INFO] : in update - no new newAguda"); + }else{ + window.localStorage['newAguda'] = "true"; + window.localStorage['agudaPosts'] = JSON.stringify(resp.data); + } + + }, function(err) { + console.error('[JCE] [INFO] : in update - can\'t get Aguda Posts from Facebook', err); + }); //Get Calendar //https://mipo.jce.ac.il/index.php/site/timetable diff --git a/www/js/controllers.js b/www/js/controllers.js index dd2ba3b..387050d 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -238,10 +238,12 @@ angular.module('starter.controllers', []) .controller('AgudaCtrl', function($scope, $stateParams, $http) { - var notesStr = window.localStorage['notes'] || null; - console.log(notesStr); - if(notesStr != null) - $scope.newss = JSON.parse(notesStr); + var aguda = window.localStorage['agudaPosts'] || null; + console.log(aguda); + console.log("[JCE] [INFO] at AgudaCtrl if there is a print. its OK"); + if(aguda != null){ + $scope.agudaAll = JSON.parse(aguda); + } @@ -460,7 +462,7 @@ angular.module('starter.controllers', []) } }; ////////////////////////////////////////////////////////// - $scope.version = "0.1.28alpha-develop_perview"; + $scope.version = "0.1.30alpha-develop_perview"; ///////////////////////////////////////////////////////// }); diff --git a/www/templates/aguda.html b/www/templates/aguda.html index 83d675c..bc42c3f 100644 --- a/www/templates/aguda.html +++ b/www/templates/aguda.html @@ -2,23 +2,19 @@
-

אגודת הסטודנטים

+

אגודת הסטודנטים

-

גרסת פיתוח - הנתונים כאן לא מתעדכנים!

+
+
+ +

{{post.contentSnippet}}

+

{{post.publishedDate}}

+
-
+
+
-
- -

פאנג'ויה!

-

November 05, 1955

-
- -
- -

את הטפסים יש לשלוח בדיוק בשעה שקיבלתם בהרשמה לתורים.

*** טפסים להורדה:
www.funjoya.co.il/funjoya-form-jr2015.pdf

***בעת הגשת הטפסים פיזית/בדוא"ל יתבצע אימות לשעה ולתאריך ע"פ מספר תעודת הזהות. סטודנט אשר לא יפעל על פי ההוראות, הזמנתו לא תתקבל.

-

1 Like 5 Comments

@@ -41,42 +37,6 @@
- -
- -
- -

טורניר שש בש

-

November 04, 2014

-
- -
- - הטורניר השנתי ממשיך... -

- 7 Like - 5 Comments -

-
- - - -
- - diff --git a/www/templates/home.html b/www/templates/home.html index c8c5e3f..c4ef4f9 100644 --- a/www/templates/home.html +++ b/www/templates/home.html @@ -8,7 +8,7 @@
- +