Commit d04f2e38 by zhiwei

添加凌晨不推送

parent ac0a1aa2
package com.zhiwei.searchhotcrawler.timer; package com.zhiwei.searchhotcrawler.timer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -26,7 +27,9 @@ public class SendWeiboHotSearchRun extends Thread{ ...@@ -26,7 +27,9 @@ public class SendWeiboHotSearchRun extends Thread{
String title = weibo.get("name").toString(); String title = weibo.get("name").toString();
String time = TimeParse.dateFormartString((Date)weibo.get("time"), "yyyy-MM-dd HH:mm:ss"); String time = TimeParse.dateFormartString((Date)weibo.get("time"), "yyyy-MM-dd HH:mm:ss");
String url = weibo.get("url").toString(); String url = weibo.get("url").toString();
sendTemplateByUserIds(title, time, url); if(Calendar.HOUR > 6 && Calendar.HOUR < 23){
sendTemplateByUserIds(title, time, url);
}
} }
}else{ }else{
sendTemplateByUserIds("最近一小时无数据", TimeParse.dateFormartString(new Date(), "yyyy-MM-dd HH:mm:ss"), null); sendTemplateByUserIds("最近一小时无数据", TimeParse.dateFormartString(new Date(), "yyyy-MM-dd HH:mm:ss"), null);
......
package com.zhiwei.searchhotcrawler.timer; package com.zhiwei.searchhotcrawler.timer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -24,7 +25,9 @@ public class SendZhihuHotSearchRun extends Thread{ ...@@ -24,7 +25,9 @@ public class SendZhihuHotSearchRun extends Thread{
String title = zhihu.get("display_query").toString(); String title = zhihu.get("display_query").toString();
String time = TimeParse.dateFormartString((Date)zhihu.get("time"), "yyyy-MM-dd HH:mm:ss"); String time = TimeParse.dateFormartString((Date)zhihu.get("time"), "yyyy-MM-dd HH:mm:ss");
String url = zhihu.get("_id").toString(); String url = zhihu.get("_id").toString();
sendTemplateByUserIds(title, time, url); if(Calendar.HOUR > 6 && Calendar.HOUR < 23){
sendTemplateByUserIds(title, time, url);
}
} }
}else{ }else{
sendTemplateByUserIds("最近一小时无数据", TimeParse.dateFormartString(new Date(), "yyyy-MM-dd HH:mm:ss"), null); sendTemplateByUserIds("最近一小时无数据", TimeParse.dateFormartString(new Date(), "yyyy-MM-dd HH:mm:ss"), null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment