Browse Source

取消热门tag门槛,清华邮箱的额外提醒信息

pull/4/head
欧醚 4 years ago
parent
commit
78bacf9626
3 changed files with 4 additions and 3 deletions
  1. +2
    -2
      app/models/trending_tags.rb
  2. +1
    -1
      app/services/fetch_link_card_service.rb
  3. +1
    -0
      public/auto_comp_email.js

+ 2
- 2
app/models/trending_tags.rb View File

@ -4,7 +4,7 @@ class TrendingTags
KEY = 'trending_tags'
EXPIRE_HISTORY_AFTER = 7.days.seconds
EXPIRE_TRENDS_AFTER = 1.day.seconds
THRESHOLD = 5
THRESHOLD = 3
LIMIT = 10
REVIEW_THRESHOLD = 3
MAX_SCORE_COOLDOWN = 2.days.freeze
@ -38,7 +38,7 @@ class TrendingTags
max_score = 0 if max_time.nil? || max_time < (at_time - MAX_SCORE_COOLDOWN)
score = begin
if expected > observed || observed < THRESHOLD
if expected > observed #|| observed < THRESHOLD
0
else
((observed - expected)**2) / expected

+ 1
- 1
app/services/fetch_link_card_service.rb View File

@ -40,7 +40,7 @@ class FetchLinkCardService < BaseService
@card ||= PreviewCard.new(url: @url)
Request.new(:get, @url).perform do |res|
if res.code == 200 && res.mime_type == 'text/html'
if res.code == 200 && res.mime_type.end_with?('text/html')
@html = res.body_with_limit
@html_charset = res.charset
else

+ 1
- 0
public/auto_comp_email.js View File

@ -6,6 +6,7 @@ em.addEventListener("blur", function( event ) {
if(ap.style.display != 'none' && em.value) {
em.value+=ap.innerText;
ap.style.display = 'none';
alert('注意:清华邮箱收取外部邮件会有至多十分钟的延迟,完成注册后请稍后再查收邮件')
}
});

Loading…
Cancel
Save