iMacros like script

aceofmyt

Registered Member
Joined
Nov 30, 2013
Messages
52
Reaction score
6
I learned a lot of things from this forum and I want to give something back.
This is the script that I am using on iMacros (Firefox/Pale Moon/Chrome extension) to like ~100 posts/day.
What it does:
  • Search for posts in your niche, based on your tags, and like them
  • Unlock NSFW posts
  • Filter posts, to show only photos
  • Real-time progress
  • Run time ~10 minutes/100 likes (You can lower the delay if you want to make it faster)
Here is the pastebin link: https://pastebin.com/8kyPLhFU
- Copy the entire script
- Save it as *.JS (JavaScript)
- Copy the .JS file in your iMacros folder
- Run it using iMacros

Here is the script, in case the link above does not work
/* 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;
tags = 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();
 
Back
Top