Google Groups Home
Help | Sign in
点击数、回复数、时间差求帖子的热度
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
lamb  
View profile
(1 user)  More options Mar 20 2007, 1:58 am
From: "lamb" <wendam...@gmail.com>
Date: Mon, 19 Mar 2007 22:58:41 -0700
Local: Tues, Mar 20 2007 1:58 am
Subject: 点击数、回复数、时间差求帖子的热度
以反正切方法求出其帖子热度。
Javascript实现方法

<script language="javascript" type="text/javascript">
var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }

}

RankAlg = Class.create();
RankAlg.prototype = {
        initialize:function(){
                var tmp = this.rankalg(600,60,24*60*60);
                var tmp2 = this.rankalg(600,60,240*60*60);
                var tmp3 =  this.rankalg(10,6,0);
                alert(tmp + " "+ tmp2 + " " +tmp3 );
        },
        rankalg:function(hitPoint, reviewPoint, timePoint){
                var HIT_WEIGHTING    = 10000.0;    //点击权重 (可根据实际操作调整)
                var REVIEW_WEIGHTING = 10000.0;    //回复权重 (可根据实际操作调整)
                var TIME_WEIGHTING   = 10000.0;    //时间权重 (可根据实际操作调整)

                var HIT_SCOPE    = 500;    //点击有效作用范围,单位:次 (可根据实际操作调整)
                var REVIEW_SCOPE = 50;     //回复有效作用范围,单位:次 (可根据实际操作调整)
                var TIME_SCOPE   = 240;    //发布时间有效作用范围,单位:小时 (可根据实际操作调整)
                var X_EFFECT_POINT = 10.0; //atan函数x变量有效点(可根据实际操作调整)

                var hit = HIT_WEIGHTING * (Math.atan(X_EFFECT_POINT/HIT_SCOPE *
hitPoint ))/1.571;
                var review =  REVIEW_WEIGHTING * (Math.atan(X_EFFECT_POINT/
REVIEW_SCOPE * reviewPoint ))/1.571;
                var time = TIME_WEIGHTING * (1.571 - Math.atan(X_EFFECT_POINT/
TIME_SCOPE * (timePoint/60/60) ))/1.571;

                var rankPoint = parseInt(hit + review + time);

                return rankPoint;
        }

}

new RankAlg();
</script>

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lamb  
View profile
(1 user)  More options Mar 20 2007, 2:03 am
From: "lamb" <wendam...@gmail.com>
Date: Mon, 19 Mar 2007 23:03:12 -0700
Local: Tues, Mar 20 2007 2:03 am
Subject: 点击数、回复数、时间差求帖子的热度
以反正切方法求出其帖子热度。
Javascript实现方法

<script language="javascript" type="text/javascript">
var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }

}

RankAlg = Class.create();
RankAlg.prototype = {
        initialize:function(){
                var tmp = this.rankalg(600,60,24*60*60);
                var tmp2 = this.rankalg(600,60,240*60*60);
                var tmp3 =  this.rankalg(10,6,0);
                alert(tmp + " "+ tmp2 + " " +tmp3 );
        },
        rankalg:function(hitPoint, reviewPoint, timePoint){
                var HIT_WEIGHTING    = 10000.0;    //点击权重 (可根据实际操作调整)
                var REVIEW_WEIGHTING = 10000.0;    //回复权重 (可根据实际操作调整)
                var TIME_WEIGHTING   = 10000.0;    //时间权重 (可根据实际操作调整)

                var HIT_SCOPE    = 500;    //点击有效作用范围,单位:次 (可根据实际操作调整)
                var REVIEW_SCOPE = 50;     //回复有效作用范围,单位:次 (可根据实际操作调整)
                var TIME_SCOPE   = 240;    //发布时间有效作用范围,单位:小时 (可根据实际操作调整)
                var X_EFFECT_POINT = 10.0; //atan函数x变量有效点(可根据实际操作调整)

                var hit = HIT_WEIGHTING * (Math.atan(X_EFFECT_POINT/HIT_SCOPE *
hitPoint ))/1.571;
                var review =  REVIEW_WEIGHTING * (Math.atan(X_EFFECT_POINT/
REVIEW_SCOPE * reviewPoint ))/1.571;
                var time = TIME_WEIGHTING * (1.571 - Math.atan(X_EFFECT_POINT/
TIME_SCOPE * (timePoint/60/60) ))/1.571;

                var rankPoint = parseInt(hit + review + time);

                return rankPoint;
        }

}

new RankAlg();
</script>

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google