由于经常在论坛发帖,需要使用图床,而一个稳定的图床比较难找,找到后基本不能批量获得代码,有一次看到别人介绍一个图床,然后介绍了GM的一个脚本可以批量获取代码,这大大减少了发帖时间,可是最忌那个图床要收费了,我又寻找了一个图床,可是那个脚本只是应那个网站,现在不能再新的图床中获取图片地址了,由于本人大一,还没有开始学习计算机语言,就在这里请会的高手帮忙。
http://userscripts.org/scripts/show/77486,这是原来那个图床的脚本,请作为参考。这是源代码
// ==UserScript==
// @name Get BBCodes from ning
// @include http://*.ning.com/*
// @author congxz6688
// ==/UserScript==
mytableCSS="#myNewText { width:170px; height:100px; background-color: #F8F8F8 !important;}";
mytableCSS+="#mygray {color:BLACK; background-image:url(
); padding: 1px 5px 1px 5px !important; }";
GM_addStyle(mytableCSS);
if(window.location.href.match(/photo(?!\/)|photo\/photo\/listForContributor|photo\/photo\/list/) != null){//descendant::
var h1haha= document.evaluate('//div[@class="xg_module module_about"]', document, null, 6, null);
if (h1haha.snapshotItem(0)){
var allimages= document.evaluate('//div[@class="ib"]/a/img', document, null, 6, null);
if(allimages.snapshotLength>0){
var myText="";
for(var i=allimages.snapshotLength-1; i >-1 ; i--){
thisCode= ""
myText += thisCode + "\r\n" + "\r\n";
var NewInput=document.createElement("input");
NewInput.type="text";
NewInput.size="16";
NewInput.id=i;
NewInput.value=thisCode;
NewInput.setAttribute("readonly", "readonly");
NewInput.addEventListener("click", selectAllText(i), false);
allimages.snapshotItem(i).parentNode.parentNode.parentNode.insertBefore(NewInput,allimages.snapshotItem(i).parentNode.parentNode.nextSibling);
}
var newh3=document.createElement("div");
newh3.id="mygray";
var newh4=document.createElement("h3");
newh4.innerHTML="鏈〉鎵€鏈夊浘鐗囩殑BBCodes";
newh3.appendChild(newh4);
var newh6=document.createElement("div");
newh6.id="myTd2";
var NewTextArea=document.createElement("textarea");
NewTextArea.id="myNewText";
NewTextArea.innerHTML=myText
NewTextArea.setAttribute("readonly", "readonly");
NewTextArea.addEventListener("click", selectAllText("myNewText"), false);
newh6.appendChild(NewTextArea);
newh3.appendChild(newh6);
h1haha.snapshotItem(0).parentNode.insertBefore(newh3,h1haha.snapshotItem(0).nextSibling);
}
}
}
function selectAllText(e){
return function(){
document.getElementById(e).select();
}
}
这是使用那个脚本获取代码的效果图
新的图床地址为
www.slide.com,这是多图预览页面,
如若需要具体页面,以及具体过程我下次再编辑。
要求:1.能够获得图片地址,并且直接就是以论坛图片代码形式出现,能在每张图片底下出现该图片的图片代码地址,并且能在页面中出现全部的图片的地址,并按照顺序排列(我上传图片都是按照编码001,002的顺序上传,能够按照这个正序排列就行了)
2.获取的全部地址,每个img代码之间要空一行,发图片是要空一行便于观看,这个很重要。
3.在多图预览页面,获取的图片地址链接是小图的连接,图片显示大小是160x100,需要把地址中的160/100替换为1500/1500,这个不替换就无法显示大图。
请论坛中的高手不要吝惜自己的能力,帮助一下吧