Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
[Userscript] Auto-like Certain Users
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="TesoMayn" data-source="post: 333242" data-attributes="member: 8605"><p>Just a basic userscript I literally just wrote.</p><p>I added the comments for those who are not experienced with jQuery, to help them understand the functions <img src="/styles/default/xenforo/smilies/emojione/tongue.png" class="smilie" loading="lazy" alt=":p" title="Stick Out Tongue :p" data-shortname=":p" /></p><p></p><p>[CODE]// ==UserScript==</p><p>// @name DevBest Auto-like</p><p>// @namespace http://tesomayn.com/</p><p>// @version 1.0</p><p>// @description Like certain user's post automatically</p><p>// @author TesoMayn</p><p>// @match https://devbest.com/threads/*</p><p>// @grant none</p><p>// ==/UserScript==</p><p></p><p>$(document).ready(function() { // Executes when the page is loaded</p><p> var users = ['TesoMayn', 'Canadian', 'Donkjam', 'RastaLulz', 'Sledmore']; // Add users you want to autolike to this array</p><p> $.each(users, function() { // Searches each user in the array</p><p> if ($('li[data-author="'+this+'"]').length) { // Checks if user has posted</p><p> $('li[data-author="'+this+'"]').each( function() { // If user has posted, like their post</p><p> $('a.LikeLink.item.control.like',this).click();</p><p> });</p><p> var total = $('li[data-author="'+this+'"] a.LikeLink.item.control.like').length; // Generates the total number of posts liked</p><p> if ( total >= 1 ) { // If there was a new post liked</p><p> console.log('Liked '+total+' of '+this+'\'s post');</p><p> } else { // If no new post was Liked</p><p> console.log('All of '+this+'\'s post are liked');</p><p> }</p><p> }</p><p> });</p><p>});[/CODE]</p></blockquote><p></p>
[QUOTE="TesoMayn, post: 333242, member: 8605"] Just a basic userscript I literally just wrote. I added the comments for those who are not experienced with jQuery, to help them understand the functions :P [CODE]// ==UserScript== // @name DevBest Auto-like // @namespace http://tesomayn.com/ // @version 1.0 // @description Like certain user's post automatically // @author TesoMayn // @match https://devbest.com/threads/* // @grant none // ==/UserScript== $(document).ready(function() { // Executes when the page is loaded var users = ['TesoMayn', 'Canadian', 'Donkjam', 'RastaLulz', 'Sledmore']; // Add users you want to autolike to this array $.each(users, function() { // Searches each user in the array if ($('li[data-author="'+this+'"]').length) { // Checks if user has posted $('li[data-author="'+this+'"]').each( function() { // If user has posted, like their post $('a.LikeLink.item.control.like',this).click(); }); var total = $('li[data-author="'+this+'"] a.LikeLink.item.control.like').length; // Generates the total number of posts liked if ( total >= 1 ) { // If there was a new post liked console.log('Liked '+total+' of '+this+'\'s post'); } else { // If no new post was Liked console.log('All of '+this+'\'s post are liked'); } } }); });[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
[Userscript] Auto-like Certain Users
Top