ClonPost

Clonador de posts.

目前為 2016-01-27 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name ClonPost
  3. // @version 0.2
  4. // @description Clonador de posts.
  5. // @match http://www.poringa.net/agregar
  6. // @include *://*.poringa.net/agregar
  7. // @include *://*.poringa.net/agregar
  8. // @copyright @Cazador4ever
  9. // @namespace http://www.taringa.net/Cazador4ever
  10. // ==/UserScript==
  11. /* jshint -W097 */
  12. 'use strict';
  13.  
  14. (function() {
  15. 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>');
  16. $('#sidebar').prepend(crear)
  17. function rss() {
  18. var id = $('#PostId').val ();
  19. var api = 'http://api.taringa.net/post/view/' + id
  20. $.getJSON( api, function(json) {
  21. var body= $('#markItUp').val();
  22. var a = $('#markItUp');
  23. var titulo = $('#titulo-input');
  24. var tit = json.title;
  25. var d = json.images[0].body;
  26. var link = json.query.results.item[0].link;
  27. var c = ''+d+''
  28. a.val(body+c).click().focus();
  29. titulo.val(tit).click().focus();});
  30. } go.onclick=rss;
  31. })();