Jump to content
UBot Underground

Beginner Question About A Friend Requesting Bot


Recommended Posts

Hi,

 

I've been trying to develop a bot that would go through member listings, checking profiles and sending friend requests.

 

It (should) works like this:

 

The bot loads the first of many (hundreds) pages.

Copy profile URLs into a list.

Visits each profile one by one in a new browser and sends a friend request.

Checks if there is a "Next page" button and if it finds it it continues.

 

But I can't make it work completely, I can visit the profiles or go through the pages but I can't figure out how to do both.

 

I tried nesting loops but it doesn't work.

 

I can't paste code because I'm writing with my tablet but anyway I just need some suggestions.

 

Thanks in advance.

Link to post
Share on other sites

First of all make simple subrroutines for each task, dont worry about loops to start with. Once youve got that done then start tinkering with the loops and such.

 

Also... are you coding ubot on your tablet? Its probably not a good thing... lol 

 

 

peace

Link to post
Share on other sites

Haha, I was on the library and I didn't want to open my laptop :D

 

Yes all those tasks work flawlessly but I can't manage to make them work together, the thing is, in order to make this happen I need some sort of looping right?

 

I'll paste some code in a moment.

 

Edit:

 

Here is the basic code for the page flipping part of the bot:

loop while($exists(<innertext="Siguiente">)) {
    click(<innertext="Siguiente">,"Left Click","No")
    wait(10)
}

And here is the one for the friend requests:

clear list(%anuncios)
    add list to list(%anuncios,$scrape attribute(<class="cti">,"fullhref"),"Delete","Global")
    set list position(%anuncios,0)
loop($list total(%anuncios)) {
    thread {
        in new browser {
            navigate($list item(%anuncios,$list position(%anuncios)),"Wait")
            wait for element(<class="i4">,"","Appear")
            wait for browser event("Everything Loaded","")
            wait(5)
            entrar()
            click(<class="i4">,"Left Click","No")
            wait for element(<innerhtml="Enviar em@il">,"","Appear")
            click(<innerhtml="Enviar em@il">,"Left Click","No")
            wait for element(<title="ENVIAR">,"","Appear")
            type text(<name="nombre">,"Contacteros","Standard")
            type text($element offset(<email field>,0),#email,"Standard")
            type text($element offset(<email field>,1),#email,"Standard")
            type text(<name="asunto">,#asunto,"Standard")
            type text(<name="mensaje">,#mensaje,"Standard")
            click(<title="ENVIAR">,"Left Click","No")
            wait for element(<class="txtMensaje">,"","Appear")
        }
    }
}
Edited by Overcoked Productions
Link to post
Share on other sites

I'm testing scraping the "next page" URL as a variable and putting it at the end of the loop, so after visiting the profiles it will go to the next page directly.

 

So far I think it can be a great way to design the bot but I'm getting JSON errors for some reason.

Link to post
Share on other sites

Hey guys I got it working and I feel like a programming god :D

 

I won't paste the code but I'll write the logic.

 

The purpose of the bot is to navigate through a classified ads web/social network and send messages to the authors to add me as a friend.

 

There are X amount of pages with Y amount of ads on each page.

To go from X1 to X2 I can click the classic NEXT button and when there are no more ads the NEXT button disappears.

I have a while loop checking if there is a NEXT button, if there is one it scrapes its URL to a variable.

After that I create a list with all the Y URLs and start visiting one by one sending a msg each time.

After that I go to the next X page using the stored URL in the variable and so on.

If there is no NEXT button it just makes a Y cycle.

 

Cheers.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...