ClonPost

Clonador de posts.

目前为 2016-01-27 提交的版本。查看 最新版本

// ==UserScript==
// @name       ClonPost
// @version    0.2
// @description  Clonador de posts.
// @match      http://www.poringa.net/agregar
// @include     *://*.poringa.net/agregar
// @include     *://*.poringa.net/agregar
// @copyright  @Cazador4ever
// @namespace http://www.taringa.net/Cazador4ever
// ==/UserScript==
/* jshint -W097 */
'use strict';

(function() {
    var crear = $('<center><textarea id="PostId" class="user-text" tabindex="700" placeholder="#PostId" autocomplete="on" style="width:100px; height: 15px; background: rgb(255, 255, 255);resize: none; "></textarea><div class="box box-solid bg-black" style="width:100%; background-color:#FFFFF"><a class="btn g go" href="#" id="go"><div class="btn-text">Clonar</div></a></div></div></center>');
    $('#sidebar').prepend(crear)
    
    
    function rss() {
        var id = $('#PostId').val ();
        var api = 'http://api.taringa.net/post/view/' + id
        $.getJSON( api, function(json) {
        var body= $('#markItUp').val();
        var a = $('#markItUp');
        var titulo = $('#titulo-input');
        var tit = json.title;
        var d = json.images[0].body;
        var link = json.query.results.item[0].link;
        var c = ''+d+''
        a.val(body+c).click().focus();
        titulo.val(tit).click().focus();});
       } go.onclick=rss;
 
   })();