» 您尚未登录:请 登录 | 注册 | 标签 | 帮助 | 小黑屋 |


发新话题
打印

SB化CNBETA的油猴脚本

posted by wap, platform: Android

jun4rui做的,看到有人要我拿出来分享一下,反正也他自己说这玩意很煞笔,大家自己玩玩就好,因为他这几天在玩steamgifts的脚本,这个是花了几分钟做了,以后还会完善,先这样了,顺便广告一下他的steamgifts网站脚本,很强大!http://steamcn.com/t83003-1-1
========================================================
// ==UserScript==
// @name       Simple Naive BETA
// @namespace  http://snbeta.jun4rui.com
// @version    0.1
// @description  简单点不好吗?PS:这不是BETA版
// @match      http://*.cnbeta.com/*
// @copyright  2013, jun4rui
// @require    http://code.jquery.com/jquery-1.10.1.min.js
// ==/UserScript==

if (location.href=="http://www.cnbeta.com/"{
    // 清空原网页
    $("body".html("";
   
    $("body".append('<table style="width:100%; border:1px solid #B8B8B8;"><tr><td style="width:300px; vertical-align:top;"><div id="listPanel" style="overflow:auto;"></div></td><td><iframe style="border:0px;width:100%; height:500px;" id="linkFrame" name="linkFrame"></iframe></td></tr></table>');
    // 设置容器高度
    $("#listPanel".height($(window).height());
    $("#linkFrame".height($(window).height());
    $.get("http://www.cnbeta.com",function(HTMLData){
        $(HTMLData).find("div.items_area dl".each(function(){
            var linkUrl        = $(this).find("a".attr("href");
            var linkText= $(this).find("a").text();
            var linkPic        = $(this).find("img").attr("src");
            var linkDesc= $(this).find("p").text();
            var linkID        = linkUrl.substring(linkUrl.lastIndexOf("/")+1,linkUrl.lastIndexOf("."));
            
            var tempHTMLStr        = '<div><a title="'+linkUrl+'" href="http://m.cnbeta.com/view.htm?id='+linkID+'" target="linkFrame">'+linkText+'</a></div>';
            
            $("#listPanel").append(tempHTMLStr);
        });
    });

}


// 新闻内容页面的处理
if (location.href.indexOf("m.cnbeta.com")!=-1){
        $("div.back,div.copy").hide();
}


TOP

mark.



TOP

posted by wap, platform: Safari

mark


TOP

这是干啥的?怎么那么多黄笑脸?

TOP

posted by wap, platform: Galaxy Nexus

马克

TOP

引用:
原帖由 HarryDean 于 2013-6-21 23:51 发表
这是干啥的?怎么那么多黄笑脸?
代码正好和论坛黄笑脸的代码一样被识别成了表情吧。。

TOP

posted by wap, platform: UC

换wap版的看啦

TOP

posted by wap, platform: iPad

mark

TOP

mark

TOP

发新话题
     
官方公众号及微博