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.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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());
}) ();