Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Change the values according to your blog/internet connection */
- var tags = ['tag1', 'tag2', 'tag3', 'tag4', 'tag5']; /* Use at least 4-5 tags */
- var likesToDo = 100; /* Follow this format: tags_count * 2 * 10 */
- var globalLoadDelay = 5; /* Wait time between page loads (seconds): FAST internet = 5, SLOW internet = 15..20 */
- /* Do not change anything below, unless you know what you are doing! */
- var currentURL = '';
- var postFilter = false;
- var progress = 0;
- var totalDelay = 0;
- var imacrosEnter = '\n'; /* NOT WORKING, OR DIFFERENT OS? TRY "\r\n", "\r", "\n/g" */
- function massLike() {
- shuffleTags();
- for (var i = 0 ; i <= 1 ; i++){
- for (var j = 0 ; j < tags.length ; j++) {
- loadURL(j, postFilter);
- unlockNSFW();
- filterPhotos();
- scrollDown();
- for (var k = 0 ; k < ((likesToDo/tags.length) / 2 ) ; k++) {
- likePost(generateRandom(1,4));
- showStatus();
- }
- }
- postFilter = true;
- }
- }
- /* Shuffles tags - Randomizes tag order */
- function shuffleTags() {
- for (var i = 0 ; i < tags.length ; i++) {
- var randomIndex = generateRandom(0,tags.length-1);
- var temp = tags[i];
- tags[i] = tags[randomIndex];
- tags[randomIndex] = temp;
- }
- }
- /* Loads the SEARCH URL, based on current TAG and FILTER (popular/recent) */
- function loadURL(currentIndex, filter) {
- currentURL = 'https://www.tumblr.com/search/' + tags[currentIndex];
- if (filter) currentURL += '/recent';
- var imacro_code = "CODE: URL GOTO=" + currentURL;
- iimPlay(imacro_code);
- }
- /* Unlock NSFW posts */
- function unlockNSFW() {
- var nsfwLock = window.document.getElementsByClassName("nsfw_filter_enabled")[0];
- if (nsfwLock == (currentURL + '#')) {
- var imacro_code = 'CODE: TAG POS=1 TYPE=I ATTR=CLASS:lock_icon' + imacrosEnter;
- imacro_code += 'WAIT SECONDS=' + globalLoadDelay;
- iimPlay(imacro_code);
- }
- }
- /* Filter posts - PHOTOS */
- function filterPhotos() {
- var imacro_code = 'CODE:' + 'SET !ERRORIGNORE YES' + imacrosEnter + 'SET !TIMEOUT_STEP 0' + imacrosEnter;
- imacro_code += 'TAG POS=1 TYPE=SPAN ATTR=TXT:Filter<SP>by<SP>post<SP>type' + imacrosEnter;
- imacro_code += 'TAG POS=1 TYPE=SPAN ATTR=TXT:Photo' + imacrosEnter;
- imacro_code += 'WAIT SECONDS=' + globalLoadDelay;
- iimPlay(imacro_code);
- }
- /* Scroll down - Load more posts */
- function scrollDown() {
- for (var i = 0 ; i < 2 ; i++ ) {
- window.scrollTo(0, (i + 1) * 25000 );
- imacro_code = "CODE: WAIT SECONDS=2";
- iimPlay(imacro_code);
- }
- }
- /* LIKE */
- function likePost(likeDelay) {
- var imacro_code = 'CODE:' + 'SET !ERRORIGNORE YES' + imacrosEnter + 'SET !TIMEOUT_STEP 0' + imacrosEnter;
- imacro_code += 'TAG POS=1 TYPE=DIV ATTR=DATA-SUBVIEW:like&&TITLE:Like&&CLASS:post_control<SP>post-control-icon<SP>like&&TXT:' + imacrosEnter;
- imacro_code += 'WAIT SECONDS=' + likeDelay;
- iimPlay(imacro_code);
- /* UPDATE STATUS */
- totalDelay += likeDelay;
- progress++;
- }
- function addDelay(seconds) {
- var imacro_code = "CODE: " + "WAIT SECONDS=" + seconds;
- iimPlay(imacro_code);
- }
- function generateRandom(minInterval, maxInterval) {
- return Math.floor((Math.random() * maxInterval) + minInterval);
- }
- function showStatus() {
- iimDisplay( '# STATUS #'+ imacrosEnter + imacrosEnter +
- 'PROGRESS: '+ progress + '/' + likesToDo + imacrosEnter +
- "DELAY: " + totalDelay + " sec" );
- }
- massLike();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement