[Affelio-cvs 1427] CVS update: affelio/lib/Affelio/Managing

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 8月 15日 (火) 00:41:54 JST


Index: affelio/lib/Affelio/Managing/NewsAggregator.pm
diff -u affelio/lib/Affelio/Managing/NewsAggregator.pm:1.27 affelio/lib/Affelio/Managing/NewsAggregator.pm:1.28
--- affelio/lib/Affelio/Managing/NewsAggregator.pm:1.27	Thu Jun 29 03:12:49 2006
+++ affelio/lib/Affelio/Managing/NewsAggregator.pm	Tue Aug 15 00:41:54 2006
@@ -14,7 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Id: NewsAggregator.pm,v 1.27 2006/06/28 18:12:49 slash5234 Exp $
+# $Id: NewsAggregator.pm,v 1.28 2006/08/14 15:41:54 slash5234 Exp $
 
 package Affelio::Managing::NewsAggregator;
 {
@@ -152,7 +152,8 @@
 
 	#########################################################
 	#Get a friend whose last_news_in is smallet (oldest).
-	my $threshold = Affelio::misc::Time::get_timestamp() - 1000; #-10m
+	my $threshold = Affelio::misc::Time::get_timestamp(-600); #-10m
+
 	my $result = $af->getFM->get_all_friend_list(
                      where => "last_news_in  < $threshold",  
 		     sort => "last_incoming",
@@ -208,53 +209,53 @@
 	    debug_print("NewsAggregator::get_one: XML-RPC error.");
 	    return;
 	}
+
 	if($ret->{message} eq ""){
 	    debug_print("NewsAggregator::get_one: No News.");
-	    return;
-	}
-
-	#########################################################
-	#Analyze returned value
-	debug_print("NewsAggregator::get_one: ret=[$ret]");
-
-	#########################################################
-	#Post data into NeighborNews table
-	my @elements = split('\n', $ret->{message});
-	my $size = @elements;
-	my $index=0;
-	while($index < $size){
-	    my $datetime = $elements[$index++];
-	    my $app_install_name = $elements[$index++];
-	    my $title = $elements[$index++];
-	    my $desc = $elements[$index++];
-	    my $creator = $elements[$index++];
-	    my $URL = $elements[$index++];
-
-	    debug_print("NewsAggregator::get_one: date = $datetime");
-	    debug_print("NewsAggregator::get_one: afid = $af_id");
-	    debug_print("NewsAggregator::get_one: app = $app_install_name");
-	    debug_print("NewsAggregator::get_one: title= $title");
-	    debug_print("NewsAggregator::get_one: desc= $desc");
-	    debug_print("NewsAggregator::get_one: creator= $creator");
-	    debug_print("NewsAggregator::get_one: URL = $URL");
 
+	}else{
 	    #########################################################
-	    #get af_type of the peer
-	    my $af_type = $af->getFM->get_attribute_by_afid($af_id, "af_type");
+	    #Analyze returned value
+	    debug_print("NewsAggregator::get_one: ret=[$ret]");
 
-	    post_news($self,
-		      datetime => $datetime,
-		      af_id => $af_id,
-		      nickname => $nickname,
-		      app => $app_install_name,
-		      title => $title,
-		      desc => $desc,
-		      creator => $creator,
-		      URL => $URL,
-		      af_type => $af_type);
+	    #########################################################
+	    #Post data into NeighborNews table
+	    my @elements = split('\n', $ret->{message});
+	    my $size = @elements;
+	    my $index=0;
+	    while($index < $size){
+		my $datetime = $elements[$index++];
+		my $app_install_name = $elements[$index++];
+		my $title = $elements[$index++];
+		my $desc = $elements[$index++];
+		my $creator = $elements[$index++];
+		my $URL = $elements[$index++];
+		
+		debug_print("NewsAggregator::get_one: date = $datetime");
+		debug_print("NewsAggregator::get_one: afid = $af_id");
+		debug_print("NewsAggregator::get_one: app = $app_install_name");
+		debug_print("NewsAggregator::get_one: title= $title");
+		debug_print("NewsAggregator::get_one: desc= $desc");
+		debug_print("NewsAggregator::get_one: creator= $creator");
+		debug_print("NewsAggregator::get_one: URL = $URL");
+		
+		#########################################################
+		#get af_type of the peer
+		my $af_type = $af->getFM->get_attribute_by_afid($af_id, "af_type");
+		
+		post_news($self,
+			  datetime => $datetime,
+			  af_id => $af_id,
+			  nickname => $nickname,
+			  app => $app_install_name,
+			  title => $title,
+			  desc => $desc,
+			  creator => $creator,
+			  URL => $URL,
+			  af_type => $af_type);
+	    }
 	}
 
-
 	#########################################################
 	#update AFuser_CORE_friends
 	my $curtime = Affelio::misc::Time::get_timestamp();


Affelio-cvs メーリングリストの案内
Back to archive index