找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
楼主: 砍柴郎

新浪图床程序

[复制链接]

899

主题

5076

回帖

1万

积分

论坛元老

积分
12959
发表于 2019-4-16 15:06:39 | 显示全部楼层
本帖最后由 ai0by 于 2019-4-16 15:19 编辑

新浪图床接口一枚:https://sbcoder.cn/api/sinaImg.html
你值得拥有



加一个演示:https://api.0161.org/sinaimg/sinaImg.php?url=https://www.baidu.com/img/bd_logo1.png
ai0by 发表于 2019-4-16 15:17

新浪图床接口一枚:https://sbcoder.cn/api/sinaImg.html
你值得拥有

呵,虾米钓到鲤鱼了。
回复

使用道具 举报

0

主题

1

回帖

4

积分

新手上路

积分
4
发表于 2019-4-16 15:10:47 | 显示全部楼层

zzr 发表于 2019-4-16 15:04

大佬帮忙解密下index.js吧。。。。这种静态的基本都用了三方接口,
[ol]
  • layui.use('element', function(){
  •   var element = layui.element;
  •   element.on('nav(demo)', function(elem){
  •     //console.log(elem)
  •     layer.msg(elem.text());
  •   });
  • });
  • $(document).ready(function() {
  •         $('.picurl > input').bind('focus mouseover',
  •                 function() {
  •                         if(this.value) {
  •                                 this.select()
  •                         }
  •                 });
  •         $("input[type='file']").change(function(e) {
  •                 images_upload(this.files)
  •         });
  •         var obj = $('body');
  •         obj.on('dragenter',
  •                 function(e) {
  •                         e.stopPropagation();
  •                         e.preventDefault()
  •                 });
  •         obj.on('dragover',
  •                 function(e) {
  •                         e.stopPropagation();
  •                         e.preventDefault()
  •                 });
  •         obj.on('drop',
  •                 function(e) {
  •                         e.preventDefault();
  •                         images_upload(e.originalEvent.dataTransfer.files)
  •                 })
  • });
  • function url_uploaddj() {
  • layer.open({
  •   type: 1 //Page层类型
  •   ,area: ['500px', '300px']
  •   ,title: '在线上传'
  •   ,shade: 0.6 //遮罩透明度
  •   ,maxmin: true //允许全屏最小化
  •   ,anim: 0 //0-6的动画形式,-1不开启
  •   ,content: '上传'
  • });  
  • };
  • var url_upload = function() {
  •         var urls = $("#urls").val();
  •         var url_arr = urls.split("\n");
  •         if(urls == "" || url_arr.length == 0) {
  •                 layer.msg('请贴入需要上传的网络图片地址.');
  •                 return
  •         }else{
  •                 layer.closeAll();
  •         }
  •         $('.layui-row > button')[1].innerHTML = '上传中';
  •         for(var i = 0; i  button')[1].innerHTML = '成功 ' + (i + 1) + '/' + url_arr.length;
  •                                         var apc = "

    https://ww1.sinaimg.cn/large/" + data.pid + ".jpg
    ";
  •                                         $('.preview').css('display', 'block');
  •                                         $(".preview>hr").after(apc)
  •                                 } else {
  •                                         $('.layui-row > button')[1].innerHTML = '第' + (i + 1) + '张上传失败'
  •                                 }
  •                                 if(typeof data.pid != 'undefined') {
  •                                         $('.layui-row > button')[1].innerHTML = '上传成功'
  •                                 } else {
  •                                         $('.layui-row > button')[1].innerHTML = '上传失败';
  •                                         $('#url-res-txt').append(data.error_msg + '\n');
  •                                         alert(data.error_msg)
  •                                 }
  •                         },
  •                         error: function(XMLResponse) {
  •                                 alert("error:" + XMLResponse.responseText)
  •                         }
  •                 })
  •         }
  • };
  • var images_upload = function(files) {
  •         var flag = 0;
  •         $('textarea').empty();
  •         $(files).each(function(key, value) {
  •                 $('.layui-row > button')[0].innerHTML = '上传中';
  •                 image_form = new FormData();
  •                 image_form.append('file', value);
  •                 console.log(image_form);
  •                 $.ajax({
  •                         url: 'https://api.oioweb.cn/sinaimg.php?type=multipart',
  •                         //multipart本地图片上传
  •                         type: 'POST',
  •                         data: image_form,
  •                         mimeType: 'multipart/form-data',
  •                         contentType: false,
  •                         cache: false,
  •                         processData: false,
  •                         dataType: 'json',
  •                         success: function(data) {
  •                                 flag++;
  •                                 if(typeof data.pid != 'undefined') {
  •                                         $('#url-res-txt').append('https://ww1.sinaimg.cn/large/' + data.pid + '.jpg\n');
  •                                         $('.layui-row > button')[0].innerHTML = '成功 ' + flag + '/' + files.length;
  •                                         var apc = "

    https://ww1.sinaimg.cn/large/" + data.pid + ".jpg
    ";
  •                                         $('.preview').css('display', 'block');
  •                                         $(".preview>hr").after(apc)
  •                                 } else {
  •                                         $('.layui-row > button')[0].innerHTML = '第' + flag + '张上传失败'
  •                                 }
  •                                 if(flag == $("input[type='file']")[0].files.length) {
  •                                         if(typeof data.pid != 'undefined') {
  •                                                 $('.layui-row > button')[0].innerHTML = '上传成功'
  •                                         } else {
  •                                                 $('.layui-row > button')[0].innerHTML = '上传失败';
  •                                                 $('#url-res-txt').append(data.error_msg + '\n');
  •                                                 alert(data.error_msg)
  •                                         }
  •                                 }
  •                         },
  •                         error: function(XMLResponse) {
  •                                 alert("error:" + XMLResponse.responseText)
  •                         }
  •                 })
  •         })
  • };
  • document.onpaste = function(e) {
  •         var data = e.clipboardData;
  •         for(var i = 0; i  a || i.x  c || i.y = n.max / 2 && (i.x -= .03 * o, i.y -= .03 * m), t = (n.max - l) / n.max, r.beginPath(), r.lineWidth = t / 2, r.strokeStyle = "rgba(" + d.c + "," + (t + .2) + ")", r.moveTo(i.x, i.y), r.lineTo(n.x, n.y), r.stroke()))
  •                         }),
  •                         x(i)
  •         }
  •         var a, c, u, m = document.createElement("canvas"),
  •                 d = t(),
  •                 l = "c_n" + d.l,
  •                 r = m.getContext("2d"),
  •                 x = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
  •                 function(n) {
  •                         window.setTimeout(n, 1e3 / 45)
  •                 },
  •                 w = Math.random,
  •                 y = {
  •                         x: null,
  •                         y: null,
  •                         max: 2e4
  •                 };
  •         m.id = l,
  •                 m.style.cssText = "position:fixed;top:0;left:0;z-index:" + d.z + ";opacity:" + d.o,
  •                 e("body")[0].appendChild(m),
  •                 o(),
  •                 window.onresize = o,
  •                 window.onmousemove = function(n) {
  •                         n = n || window.event,
  •                                 y.x = n.clientX,
  •                                 y.y = n.clientY
  •                 },
  •                 window.onmouseout = function() {
  •                         y.x = null,
  •                                 y.y = null
  •                 };
  •         for(var s = [], f = 0; d.n > f; f++) {
  •                 var h = w() * a,
  •                         g = w() * c,
  •                         v = 2 * w() - 1,
  •                         p = 2 * w() - 1;
  •                 s.push({
  •                         x: h,
  •                         y: g,
  •                         xa: v,
  •                         ya: p,
  •                         max: 6e3
  •                 })
  •         }
  •         u = s.concat([y]),
  •                 setTimeout(function() {
  •                                 i()
  •                         },
  •                         100)
  • }();
  • layer.msg('小提示:可以直接Ctrl+V粘贴上传喔~', function(){
  • });[/ol]复制代码
  • 回复

    使用道具 举报

    18

    主题

    177

    回帖

    440

    积分

    中级会员

    积分
    440
    发表于 2019-4-16 15:11:51 | 显示全部楼层
    这几天.已经陆陆续续有人反馈新浪对一些地区开始进行防盗了..今天已经把图片全部搞到本地备份,就等新浪失效了.替换成自己的图了~
    回复

    使用道具 举报

    42

    主题

    396

    回帖

    970

    积分

    高级会员

    积分
    970
    发表于 2019-4-16 15:06:00 | 显示全部楼层

    magickey 发表于 2019-4-16 15:40



      你这头像看着就欠打

    回复

    使用道具 举报

    899

    主题

    5076

    回帖

    1万

    积分

    论坛元老

    积分
    12959
    发表于 2019-4-16 15:17:28 | 显示全部楼层
    新浪图床不是快凉了吗,还用。。。
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-5-9 15:36 , Processed in 0.017090 second(s), 3 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表