Skip to content

Instantly share code, notes, and snippets.

@eewee
Created October 13, 2016 14:47
Show Gist options
  • Save eewee/db9b389b68ad944eb370b042195f8d57 to your computer and use it in GitHub Desktop.
Save eewee/db9b389b68ad944eb370b042195f8d57 to your computer and use it in GitHub Desktop.
iMacro : linkedin visite profil group members
// Auto-visit profiles of group members on Linkedin with iMacros
// Configure :
// - email linkedin
// - password linkedin
// - proxy (option)
// To learn more about iMacros: http://imacros.net/
// 1. Variables Initialization
var macro, proxy, linkedinEmail, linkedinPassword, linkedinGroup, i, j;
macro = '';
proxy = '';
linkedinEmail = 'your_email@gmail.com';
linkedinPassword = 'your_password';
// Page "members" du groupe
linkedinGroup = 'https://www.linkedin.com/groups/154024/members'
// 2. Macro Initialization
macro += 'CODE:' + '\n';
macro += 'SET !TIMEOUT_STEP 2' + '\n';
macro += 'SET !TIMEOUT_TAG 2' + '\n';
macro += 'SET !TIMEOUT_PAGE 45' + '\n';
macro += 'SET !ERRORIGNORE YES' + '\n';
// 3. Clear Cookies, Cache and Set a Proxy
macro += "CLEAR" + "\n";
if (proxy !== "") {
macro += "PROXY ADDRESS=" + proxy + "\n";
}
// 4. Linkedin Sign In
macro += 'TAB T=1' + '\n';
macro += 'TAB CLOSEALLOTHERS' + '\n';
macro += 'WAIT SECONDS=1' + '\n';
macro += 'URL GOTO=https://www.linkedin.com/uas/login' + '\n';
macro += 'TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://www.linkedin.com/uas/login-submit ATTR=ID:session_key-login CONTENT=' + linkedinEmail + '\n';
macro += 'TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:https://www.linkedin.com/uas/login-submit ATTR=ID:session_password-login CONTENT=' + linkedinPassword + '\n';
macro += 'WAIT SECONDS=2' + '\n';
macro += 'TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:https://www.linkedin.com/uas/login-submit ATTR=NAME:signin' + '\n';
// 5. Auto-Visit & Close Profiles
macro += 'WAIT SECONDS=2' + '\n';
macro += 'URL GOTO=' + linkedinGroup + '\n';
macro += 'WAIT SECONDS=1' + '\n';
var iA = 1;
var iB = 10;
for (i = 1; i <= 25; i++) {
for (j = iA; j <= iB; j++) {
macro += 'EVENT TYPE=CLICK SELECTOR="li.member-view:nth-child(' + j + ') > div:nth-child(1) > div:nth-child(1) > a:nth-child(1) > figure:nth-child(1) > img:nth-child(1)" BUTTON=0 MODIFIERS="ctrl"' + '\n';
macro += 'WAIT SECONDS=2' + '\n';
}
iA = iB+1;
iB = iA+9
macro += 'TAB T=2' + '\n';
for (j = 1; j <= 10; j++) {
macro += 'TAB CLOSE' + '\n';
}
macro += 'URL GOTO=javascript:window.scrollBy(0,10000)' + '\n';
macro += 'WAIT SECONDS=10' + '\n';
}
// 6. Run The Macro
iimDisplay("iMacro est en cours de travail.");
iimPlay(macro);
@klimeckt
Copy link

Hi, If I run the script it working until opening of the group. After that there is happening nothing. Do you have an idea to let it run? Best, Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment