Jump to content
UBot Underground

Recommended Posts

Hi all,

I thought I'd make my first post somewhat useful by posting a collection of UBot snippets that I made & saved onto my HDD some time ago. I've updated quite a few, and tested all of them, they're all working (As of 24/08/2012).

 

Some snippets will seem like they wait for quite a lot of things, this is to ensure people with poor, or slow internet is able to successfully use them.

 

Login to Twitter via UI button click:

 

 

ui button("Login to Twitter") {
clear cookies
navigate("https://mobile.twitter.com/session/new", "Wait")
wait for element(<class="inputs">, "", "Appear")
click(<username field>, "Left Click", "No")
type text(<username field>, $prompt("What is your Twitter username?"), "Standard")
click(<password field>, "Left Click", "No")
type text(<password field>, $prompt("What is your Twitter password?"), "Standard")
click(<login button>, "Left Click", "No")
}

 

Although this does only login to the mobile version of Twitter, it still counts as a login on the full version.

 

________________________

 

 

Logout of Twitter via UI button click:

 

 

ui button("Logout of Twitter") {
clear cookies
navigate("https://mobile.twitter.com", "Wait")
wait for browser event("Everything Loaded", "")
if($exists(<class="inputs">)) {
	then {
	}
	else {
		click(<value="Sign out">, "Left Click", "No")
	}
}
}

 

 

Clearing the cookies should do the job of logging out, but if for some reason they fail, we've got a backup loop just to double check.

 

________________________

 

 

Create a Twitter account via UI button click:

 

 

ui button("Create Twitter account") {
clear cookies
reset account("Any")
navigate("http://mobile.twitter.com", "Wait")
wait for element(<id="main_content">, "", "Appear")
type text(<full name field>, "{$account data("First Name")} {$account data("Last Name")}", "Standard")
set(#email, $prompt("Email address:"), "Global")
type text(<email field>, #email, "Standard")
set(#password, $prompt("Password:"), "Global")
type text(<password field>, #password, "Standard")
type text(<name="captcha_response_field">, $solve captcha(<create account link>), "Standard")
click(<type="submit">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
wait for element(<class="settings-section">, "", "Appear")
set(#username, $scrape attribute(<name="settings[screen_name]">, "value"), "Global")
alert("
	Email: {#email}
	Username: {#username}
	Password: {#password}
")
}

 

 

This snippet will prompt the user for an email address, it can easily be changed to connect to a mail server, and validate the account.

 

Also, towards the end of the snippet, when ran, the user is offered the chance to select a username, however, if no username is selected, Twitter will automatically apply the username located inside the textbox. If you don't understand, please, see the spoiler below.

 

 

http://img14.imageshack.us/img14/694/twitterautoun.png

 

 

 

________________________

 

 

Send a Tweet via UI button click:

 

 

ui button("Send a Tweet!") {
navigate("https://mobile.twitter.com/compose/tweet", "Wait")
wait for browser event("Everything Loaded", "")
if($exists(<name="tweet[text]">)) {
	then {
		type text(<name="tweet[text]">, $prompt("What would you like to tweet?"), "Standard")
		click(<name="commit">, "Left Click", "No")
		wait for browser event("Everything Loaded", "")
		if($exists(<class="toast flash">)) {
			then {
				alert("Tweet sent!")
			}
			else {
			}
		}
	}
	else {
		alert("You aren\'t logged in to Twitter.")
	}
}
}

 

 

Prompts the user for the Tweet message, can be easily swapped around to Tweet items from a list.

Also checks if the user is logged in, if they aren't it simply tells them so.

 

________________________

 

 

Delete all Tweets via UI button:

 

 

ui button("Delete all Tweets") {
set(#confirmation, $confirm("Are you sure you want to DELETE ALL of your tweets?
Please, remember: This cannot be un-done, you have been warned."), "Global")
if($comparison(#confirmation, "=", $true)) {
	then {
	}
	else {
		stop script
	}
}
navigate("https://mobile.twitter.com/account", "Wait")
wait for browser event("Everything Loaded", "")
if($exists(<class="fullname">)) {
	then {
		clear list(%tweets)
		add list to list(%tweets, $list from text($scrape attribute(<href=w"/statuses/*/delete?return_url=%2F">, "href"), "?return_url=%2F"), "Delete", "Global")
		set list position(%tweets, 0)
		loop($list total(%tweets)) {
			navigate("mobile.twitter.com{$next list item(%tweets)}", "Wait")
			wait for browser event("Everything Loaded", "")
			click(<name="commit">, "Left Click", "No")
			wait for browser event("Page Loaded", "")
			wait(2)
		}
	}
	else {
		alert("Not logged in.")
	}
}
}

 

 

This snippet has been test on a few accounts with no more than 8 tweets. It may need some slight tweaking to support a larger number.

It also prompts the user, confirming if they really want to delete all the tweets, this is to avoid disastrous accidents. Oh, it also waits two seconds after each tweet removal, this is too avoid being flagged, and possibly banned by Twitter.

 

________________________

 

I'll be posting more as I find them, unfortunately, I had the habit of saving my code under random characters in various folders. Not all of them are for Twitter, these are just the ones I luckily found in a folder.

Edited by Snapper Head
  • Like 3
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...