Created
April 1, 2018 10:32
-
-
Save karubabu/735afce19604267c1cac9f22b4c1d50a to your computer and use it in GitHub Desktop.
ついったーの画像を貰っていくやつです
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name get images from permalink tweet | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author karubabu | |
// @match https://twitter.com/*/status/* | |
// @grant GM_download | |
// @grant GM_notification | |
// @grant GM_registerMenuCommand | |
// ==/UserScript== | |
GM_registerMenuCommand("DL images", run); | |
function run(){ | |
(function() { | |
'use strict'; | |
// Your code here... | |
var a = document.querySelector(".tweet.permalink-tweet "); | |
var b = a.querySelectorAll(".AdaptiveMedia-photoContainer.js-adaptive-photo > img"); | |
for (let item of b) | |
{ | |
var strsplit = item.src.split("/"); | |
var fname = strsplit[strsplit.length -1]; | |
GM_download({url: item.src, name: fname, onload: GM_notification(fname + " complete!")}); | |
} | |
})(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment