[运营交流]
清除某站「xxx更新重要通告」章节的办法
某站为了防采集,在最后面加了一个章节,这样应该就能应付掉很多采集器了,比如关关,对比最新章节,不太容易破。
废话不多说,最快的方法还是直接从数据库里删掉,也不用太勤,一天删一次就可以了,多少会生成一些死链,量很少不用太在意,好了,进入正题。
linux用户的话,
用root登录
su - postgres
psql yidu
update t_chapter set deleteflag = true where chaptername = articlename || '更新重要通告';
update t_article t set lastchapter = (select chaptername from t_chapter tc where chapterno in (select max(chapterno) from t_chapter where deleteflag = false group by articleno) and tc.articleno = t.articleno) , lastchapterno = (select chapterno from t_chapter tc where chapterno in (select max(chapterno) from t_chapter where deleteflag = false group by articleno) and tc.articleno = t.articleno) where articleno in (select articleno from t_chapter where chaptername = articlename || '更新重要通告' group by articleno);
\q
命令详解,就不写在后面了,不容易复制 ,看下面
切换到数据库用户 su - postgres
连接数据库 psql yidu
把xxx更新重要通告 标识为删除 update t_chapter set deleteflag = true where chaptername = articlename || '更新重要通告';
更新小说的最新章节信息,可能执行的时间长一些,不用担心,多等等(SQL应该有优化的空间,功能够就先用着啦) update t_article t set lastchapter = (select chaptername from t_chapter tc where chapterno in (select max(chapterno) from t_chapter where deleteflag = false group by articleno) and tc.articleno = t.articleno) , lastchapterno = (select chapterno from t_chapter tc where chapterno in (select max(chapterno) from t_chapter where deleteflag = false group by articleno) and tc.articleno = t.articleno) where articleno in (select articleno from t_chapter where chaptername = articlename || '更新重要通告' group by articleno);
退出 \q
执行完这5条就可以退出了,易读系统本身有缓存,过10分钟在去看应该就没有啦!
windows用户的,打开pgadmin,连接yidu数据库,然后执行3,4,就可以啦