Extract all tweets from Twitter

Get all tweets from a tweeter timeline in one go. A button is provided in the navigation bar. Click the button, get the tweets in the textbox. Copy tweets and save locally.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Extract all tweets from Twitter
// @name:ja     Extract all tweets from Twitter
// @namespace   https://greasyfork.org/ja/users/100769-atul-k
// @description Get all tweets from a tweeter timeline in one go. A button is provided in the navigation bar. Click the button, get the tweets in the textbox. Copy tweets and save locally. 
// @description:ja Get all tweets from a tweeter timeline in one go. A button is provided in the navigation bar. Click the button, get the tweets in the textbox. Copy tweets and save locally. 
// @include     https://twitter.com/*
// @include     https://twitter.com/*
// @author      atul k
// @version     0.5.0
// @grant       none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @license     MIT License
// ==/UserScript==
(function () {  

  var createButton = function () {
    var button = document.createElement('li');
    button.setAttribute('class', 'dm-nav');
    button.innerHTML = 
       ' <a data-original-title="" role="button" href="#"  data-placement="bottom"> ' +
        '  <span class="Icon Icon--dm Icon--large"></span> ' +
        '  <span class="text">Get Tweets</span> ' +
        '  <span class="dm-new"><span class="count-inner"></span></span> '  +
        '</a>';
    button.addEventListener('click', function (event) {
        event.stopPropagation();
        var allTweets = $.map($('.tweet-text'), function(val) { return [$(val).text()]})
        var bigString = ""
        allTweets.forEach(function(e, i) {
            bigString += e + "\n\n"
        })
        //window.prompt("Copy to clipboard: Ctrl+C, Enter", bigString); 
        if (confirm(bigString) == true) {
            x = "sdf"
        } else {
            x = "You pressed Cancel!";
        }
      //alert(bigString);
    });
    button.addEventListener('mouseenter',function(){
      
    });
    button.addEventListener('mouseleave',function(){
      
    });
    return button;
  };
  
    var list = document.getElementById('global-actions');
    list.appendChild(createButton());
}) ();