Extract all tweets for Twitter

get all tweets from a page

As of 2017-02-08. See the latest version.

// ==UserScript==
// @name        Extract all tweets for Twitter
// @name:ja     Extract all tweets for Twitter
// @namespace   https://gf.zukizuki.org/ja/users/100769-atul-k
// @description get all tweets from a page
// @description:ja get all the text in one go
// @include     https://twitter.com/*
// @author      atul
// @version     0.4.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="#" class="js-tooltip js-dynamic-tooltip global-dm-nav" 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());
}) ();