gilad 0 Posted June 27, 2010 Report Share Posted June 27, 2010 Hi,I love UBot yet am still struggling to learn it.As an exercise I'm building a simple twitter friend adder bot. I managed to get through the input, login, keyword search parts but I can't figure out, one I'm on a friend search results page, how do I loop over all "follow this x" buttons on the page? I can choose them by attribute, but "click chosen" only clicks the first one.Twitter is using some jQuery to do the ajax friend adding but I think it shouldn't be an issue.The attribute I choose from is a outer html, looking for a wildcard on: <BUTTON class=btn title="" type=submit value="Actions" href="/friendships/create/"* I basically want to loop through the people on the page and hit "follow" for each one. Any advice on how to do that? Quote Link to post Share on other sites
tessel 3 Posted June 27, 2010 Report Share Posted June 27, 2010 gilad, still wet behind the ears myself and very new to Ubot but did you try or is it possible to scrape the links you need to click to a list and then process the list clicking on them as it goes through the list? I could be completely wrong as I am not a programmer (nightmares from doing Java classes at uni many years ago). If that won't work, is it possible to use some kind of "while" statement? Quote Link to post Share on other sites
alcr 135 Posted June 27, 2010 Report Share Posted June 27, 2010 gilad, still wet behind the ears myself and very new to Ubot but did you try or is it possible to scrape the links you need to click to a list and then process the list clicking on them as it goes through the list? I could be completely wrong as I am not a programmer (nightmares from doing Java classes at uni many years ago). If that won't work, is it possible to use some kind of "while" statement?This is pretty much the correct way, yes. Quote Link to post Share on other sites
gilad 0 Posted June 27, 2010 Author Report Share Posted June 27, 2010 Hi and thanks for the replies.That won't work in this case as the "follow" button all have the same href and use Jquery to somehow AJAX submit the follow command.That means I must find someway to loop on all buttons on the screen and "click" them. Any suggestion? Quote Link to post Share on other sites
JohnB 255 Posted June 27, 2010 Report Share Posted June 27, 2010 I have already made this bot, and it works great. you can view all the code in it to see how to do what you are trying to do. I hope it helps. John Quote Link to post Share on other sites
gilad 0 Posted June 27, 2010 Author Report Share Posted June 27, 2010 Your a life saver John, Thanks!I've studied the code and I see what I was missing (the /* part). Thank you so much for sharing! Quote Link to post Share on other sites
JohnB 255 Posted June 28, 2010 Report Share Posted June 28, 2010 No problem! I'm glad you figured it out. John Quote Link to post Share on other sites
lorenz123 0 Posted May 28, 2018 Report Share Posted May 28, 2018 Hey if you still have the code I would be very happy to see it to ! Quote Link to post Share on other sites
UBotBuddy 331 Posted May 28, 2018 Report Share Posted May 28, 2018 Hey Lorenz123 You will likely get a faster response if you create your on Thread with what you need help with. This is a very old thread and the code for it is likely based on version 2 of UBot and not the current version 5 that we are all using. Thanks Buddy 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.