1. 程式人生 > >js微博自動轉發——小籠包專用教程貼

js微博自動轉發——小籠包專用教程貼

1、開啟要轉發的微博的頁面,右擊空白處找到“審查元素”或者“檢查”調出控制檯;選擇network;

2、當前頁正常轉發一次,會得到一個forward檔案,單擊開啟,選擇header

複製url、mid、location、pdetall這四個資料到一邊

3、點選console,將以下原始碼放到空白處,將以下四個資料改成剛才複製的你的id資訊

更改引號裡轉發內容為要轉發的文字(引號莫刪除)

4、改好之後,按回車即可(改一個別按回車都改完再按);等待700秒提示成功即設定成功,此頁面暫時不能重新整理,等到提示失敗再重新整理,大概過一個小時才可以繼續轉發,將原始碼重複放到console裡再來一遍,記得改成自己的資訊。over

原始碼:

 // 評論微博並轉發
function commentWeibo(content) {
  var Data = new FormData();
  Data.append('pic_src', '');
  Data.append('pic_id', '');
  Data.append('appkey', '');
  // mid為該微博的id
  Data.append('mid', '4288633252742577');
  Data.append('style_type', '2');
  Data.append('mark', '');
  //reason為轉發內容
  Data.append('reason', content);
  Data.append('location', 'page_100306_single_weibo');
  Data.append('pdetail', '1003061594052081');
  Data.append('module', '');
  Data.append('page_module_id', '');
  Data.append('refer_sort', '');
  Data.append('is_comment_base', '1');
  // Data.append('is_comment', '1');
  Data.append('rank', '0');
  Data.append('rankid', '');
  Data.append('isReEdit', '');
  Data.append('_t', '0');
 
  var xhr = new XMLHttpRequest();
  xhr.timeout = 3000;
  xhr.responseType = "text";
  xhr.open('POST', 'https://weibo.com/aj/v6/mblog/forward?ajwvr=6&domain=100306&__rnd=' + new Date().getTime(), true);
  xhr.onload = function(e) {
    if (this.status == 200 || this.status == 304) {
      var data = JSON.parse(this.responseText);
      if (data.code == "100000") {
        // 轉發微博成功
        console.log("成功",content);
      }else {
        // 轉發微博失敗
        console.log("失敗",data,content);
      }
    }
  };
  xhr.send(Data);
}
var arr = ['[給你小心心]','[中國贊]','[doge]','[喵喵]','[抱抱]','[跪了]','[吃瓜]','[允悲]','[壞笑]','[笑cry]','[饞嘴]','[頂]','[微笑]','[偷笑]','[舔屏]','[親親]','[太開心]','[擠眼]','[色]','[可愛]','[錢]','[思考]','[困]','[互粉]','[睡]','[並不簡單]','[害羞]','[哈哈]','[哼]','[哈欠]','[笑而不語]','[嘻嘻]','[愛你]','[吃驚]','[汙]','[鼓掌]','[憧憬]','[酷]','[good]',,'[心]','[作揖]','[NO]','[ok]','[贊]','[拳頭]','[haha]','[加油]','[握手]','[來]','[男孩兒]','[女孩兒]','[耶]','[奧特曼]','[話筒]','[禮物]','[飛機]','[乾杯]','[圍脖]','[圍觀]','[蛋糕]','[微風]','[音樂]','[鮮花]','[太陽]','[兔子]','[照相機]','[熊貓]','[喜]','[威武]','[弗萊見錢眼開]','[帶著微博去旅行]','[偷樂]','[笑哈哈]','[羞嗒嗒]','[好愛哦]','[贊啊]','[求關注]','[好喜歡]','[鋼鐵俠]','[美國隊長]','[浩克]','[雷神]','[洛基]','[蜘蛛俠]','[奇異博士]','[黑寡婦]','[冬兵]','[格魯特]','[米奇喜歡]','[米奇飛吻]','[米奇大哭]','[米奇比心]','[Aloha]','[米奇愛你]','[哆啦A夢花心]','[哆啦A夢害怕]','[哆啦A夢吃驚]','[哆啦A夢汗]','[哆啦A夢微笑]','[伴我同行]','[哆啦A夢笑]','[哆啦A夢無奈]','[哆啦A夢美味]','[哆啦A夢開心]','[哆啦A夢親親]','[星星]','[給力]']
var arr1 = ["一種信仰,是一種陽光的追求","山是故人眸,柳是纖纖手","恆星","月夜明","心絃初驚","懷風曾寄影","雲柯雨澤相映","漫天飛花喜看景",'非魚戲水江心躍影',"如柏巍岑穿雲曙光迎","未來可期共許風雨同行","此情何遲餘生更堅定","斜暉照璧默然如鏡","浮生若夢曉以情","風聲過萬林應","倚胡楊賞晴","紅雪浮冰","漸顯名","風靜","聆" ,"琴瑟願與,共沐春秋","瀅溪潺潺,炊煙悠悠","敢請東風,玉成雙偶","遙遞佳信,知否知否","為理雲鬢,為簪銀鉤","明月可鑑,情深亦壽","此生相依,人間白首","千金不易,清茶淡粥,","相思不掃,久積彌厚","給與隨風,四海同心齊寄望","朱門回首,半輪明月宜相許","一盞清茶,流光逐影情繫你","龍鳳呈祥,颯沓江湖半沉浮","先修於心,煙雨濛濛任平生","生願於靈,萬般風景如水若","的卻初萌,朗日隨雲皆似夢","七情入眼,低頭淺笑一心收","夕照流風,不留餘生長久視","祝酒淺斟,遍書滿紙短情長 ","福緣相結,抹煙談笑映霓虹","願你所到之處皆為熱土","願你所遇之人皆為良善","縱有山河巍巍,不及你笑眼彎彎"]
function randomWord(randomFlag, min, max){
    var str = "",range = min;
        
   // 隨機產生
    if(randomFlag){ 
      range = Math.round(Math.random() * (max-min)) + min;
    }
    for(var i=0; i<range; i++){
        pos = Math.round(Math.random() * (arr.length-1));
        str += arr[pos];
    }
    return str;
}
// 每700秒評論一次
var count = 0;
setInterval(function(){
  var str = "#朱一龍[超話]# 感謝@路易威登,感謝LV邀請,讓我們看到了朱一龍不同於以往的另外一面,跟隨哥哥的腳步一起探索藝術的魅力吧@朱一龍 #朱一龍幻樂之城# " +arr1[count%108]+arr[count%108];
  count++;
  commentWeibo(str);
}, 700001);