Comment.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. window.onload = function () {
  2. }
  3. Printing = function (data) {
  4. var warp = $("#warp"),
  5. textarea = $("#textarea");
  6. textarea.html("");
  7. if (data.length <= 0) {
  8. textarea.html("请求失败,检查所输入的cookie、微博id、页码数是否正确,如正确请联系管理员!");
  9. }
  10. else {
  11. for (var i = 0; i < data.length; i++) {
  12. textarea[0].innerHTML += delHtmlTag(data[i].text) + '\n';
  13. // textarea[0].value += (i + 1) + "、" + data[i].text + "\n";
  14. }
  15. }
  16. }
  17. Search = function () {
  18. var cookie = $("#cookie").val(),
  19. wbid = $("#wbid").val(),
  20. page = $("#page").val();
  21. // wbid = "4173028302302955",
  22. // page = "1";
  23. $.ajax({
  24. type: "get",
  25. url: "http://weibo.1473.cn/python?id=" + wbid + "&page=" + page + "&cookie=" + encodeURIComponent(cookie),
  26. success: function (data) {
  27. console.log(eval(data));
  28. Printing(eval(data));
  29. },
  30. error: function (a, b, c) {
  31. $("#textarea").html("请求失败,检查所输入的cookie、微博id、页码数是否正确,如正确请联系管理员!");
  32. }
  33. });
  34. }
  35. function delHtmlTag(str) {
  36. return str.replace(/<[^>]+>/g, "");//去掉所有的html标记
  37. }