12345678910111213141516171819202122232425262728293031323334353637383940 |
- window.onload = function () {
- }
- Printing = function (data) {
- var warp = $("#warp"),
- textarea = $("#textarea");
- textarea.html("");
- if (data.length <= 0) {
- textarea.html("请求失败,检查所输入的cookie、微博id、页码数是否正确,如正确请联系管理员!");
- }
- else {
- for (var i = 0; i < data.length; i++) {
- textarea[0].innerHTML += delHtmlTag(data[i].text) + '\n';
- // textarea[0].value += (i + 1) + "、" + data[i].text + "\n";
- }
- }
- }
- Search = function () {
- var cookie = $("#cookie").val(),
- wbid = $("#wbid").val(),
- page = $("#page").val();
- // wbid = "4173028302302955",
- // page = "1";
- $.ajax({
- type: "get",
- url: "http://weibo.1473.cn/python?id=" + wbid + "&page=" + page + "&cookie=" + encodeURIComponent(cookie),
- success: function (data) {
- console.log(eval(data));
- Printing(eval(data));
- },
- error: function (a, b, c) {
- $("#textarea").html("请求失败,检查所输入的cookie、微博id、页码数是否正确,如正确请联系管理员!");
- }
- });
- }
- function delHtmlTag(str) {
- return str.replace(/<[^>]+>/g, "");//去掉所有的html标记
- }
|