hecolivares 1 Posted October 10, 2017 Report Share Posted October 10, 2017 I´m checking username availability within https://twitter.com/settings/account. Twitter automatically tells you if a name is available. You can use Type Text and Change attribute to insert names from a file or table. The problem is that Twitter isn´t showing availability when feeding data through Ubot commands. It only works when you manually type the text. I´ve also tried Typewriter effects... still doesn´t work. Any help would be great. Quote Link to post Share on other sites
hecolivares 1 Posted October 10, 2017 Author Report Share Posted October 10, 2017 BTW. Type Keys works... but it´s not ideal in a multi thread situation. Landing the position is very difficult. Quote Link to post Share on other sites
Gogetta 263 Posted October 11, 2017 Report Share Posted October 11, 2017 Here try this.... ui text box("Username:", #Username) set(#ReturnedJson, $read file("https://twitter.com/users/username_available?username={#Username}"), "Global") load html(#ReturnedJson) Quote Link to post Share on other sites
hecolivares 1 Posted October 11, 2017 Author Report Share Posted October 11, 2017 Thanks.... I just wish I was smart enough to apply that. I ran a few scenarios and always got this error... Quote Link to post Share on other sites
Gogetta 263 Posted October 11, 2017 Report Share Posted October 11, 2017 I'm uploading the script exactly as it was when I tested it in the video. Not sure why it's not working on your end. See video here: https://screencast-o-matic.com/watch/cb6XimIEQz Twitter Check Availability.ubot Quote Link to post Share on other sites
hecolivares 1 Posted October 11, 2017 Author Report Share Posted October 11, 2017 It works perfectly... have you tried running it with proxies? Haven´t been able to and after a while I get a error from twitter saying I´m sending too many requests. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 11, 2017 Report Share Posted October 11, 2017 Read file is a great trick but since you want to use proxies I would switch to using this plugin because it will be more reliable and I don't think read file uses the proxies from the browser (not sure on that): http://network.ubotstudio.com/forum/index.php/topic/20002-free-heopas-custom-plugin-thread-lock-sqlite-thread-variables-email-ini-clipboard/ You can then do it like this (I just modified Gogettas code to work with this) ui text box("Username:",#Username) ui text box("Proxy:",#proxy) set(#ReturnedJson,$plugin function("HeopasCustom.dll", "$Heopas HTTP Get", "https://twitter.com/users/username_available?username={#Username}", #proxy, "", "", "", ""),"Global") load html(#ReturnedJson) Quote Link to post Share on other sites
hecolivares 1 Posted October 12, 2017 Author Report Share Posted October 12, 2017 Read file is a great trick but since you want to use proxies I would switch to using this plugin because it will be more reliable and I don't think read file uses the proxies from the browser (not sure on that): http://network.ubotstudio.com/forum/index.php/topic/20002-free-heopas-custom-plugin-thread-lock-sqlite-thread-variables-email-ini-clipboard/ You can then do it like this (I just modified Gogettas code to work with this) ui text box("Username:",#Username) ui text box("Proxy:",#proxy) set(#ReturnedJson,$plugin function("HeopasCustom.dll", "$Heopas HTTP Get", "https://twitter.com/users/username_available?username={#Username}", #proxy, "", "", "", ""),"Global") load html(#ReturnedJson)Thanks for that. However I was hoping you could help me out with multi threading. I applied everything on the video you recently posted but I´m doing something wrong. At the end of the day I need for the program to go through the whole list of usernames in a multi thread style. I´ll probably be going through thousands of Usernames. Here is what I have. ui drop down("Set Number of Threads","1,2,3,4,5",#ThreadCount) ui block text("Users",#User list) ui save file("Available Twitter Users",#Available Twitter User File) ui stat monitor("Countdown to finish",#var_CYC_Keyword_CRT) loop while($comparison(#UsedThread,">= Greater than or equal to",#ThreadCount)) { wait(1) } set(#UsedThread,0,"Global") increment(#UsedThread) thread { in new browser { loop while($comparison(#var_CYC_Keyword_CRT,">",0)) { add list to list(%lst_Keywords,$list from text(#User list,$new line),"Delete","Global") clear list(%lst_Keywords) set(#var_CYC_Keyword_CRT,$list total(%lst_Keywords),"Global") set list position(%lst_Keywords,#var_CYC_Keyword_CRT) set(#Username,$list item(%lst_Keywords,$list position(%lst_Keywords)),"Global") set(#ReturnedJson,$read file("https://twitter.com/users/username_available?username={#Username}"),"Global") load html(#ReturnedJson) wait for browser event("Everything Loaded","") if($exists(<image="___IMAGE___0___IMAGE___">)) { then { append to file(#Available Twitter User File,"{#Username}{$new line}","End") decrement(#UsedThread) } else { } } } } decrement(#var_CYC_Keyword_CRT) } I think all is needed is a re-arrange. The script is tested on it´s own.... it works. Thanks for any help. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 12, 2017 Report Share Posted October 12, 2017 I can see that you tried to adapt the code from the video and that you got a lot of things right but it does need to be rearranged. The most important thing to point out is that you need to have a main loop which is not inside of your thread. The thread should called from within your main loop. So I am going to write out the structure so that it is easier to see and then I'll fix your code.So here is the main structure: ui drop down("Thread Count","1,2,3,4,5",#threadCount) comment("Reset used threads on each run") set(#usedThreads,0,"Global") comment("Loop for the number of usernames you want to check") loop(#numberOfAccountsToCheck) { comment("Wait for an open thread") loop while($comparison(#usedThreads,">= Greater than or equal to",#threadCount)) { wait(1) } comment("Open a thread") increment(#usedThreads) comment("Call the thread") CoreOfYourProgram() wait(0.1) } define CoreOfYourProgram { thread { comment("This is where you check if the account is available") divider comment("Close the thread") decrement(#usedThreads) } }Now in order for yours to work properly I don't think using read file is going to be a good idea for this. It may work but I think you should use Heopas plugin instead (it's free). You will need to check for the availability and then add it to a list I put a comment where you can do that but this will get you 95% of the way and if you can't figure it out let me know: ui drop down("Set Number of Threads","1,2,3,4,5",#ThreadCount) ui block text("Users",#User list) ui save file("Available Twitter Users",#Available Twitter User File) ui stat monitor("Countdown to finish",#var_CYC_Keyword_CRT) clear list(%lst_Keywords) add list to list(%lst_Keywords,$list from text(#User list,$new line),"Delete","Global") set(#UsedThread,0,"Global") loop($list total(%lst_Keywords)) { loop while($comparison(#UsedThread,">= Greater than or equal to",#ThreadCount)) { wait(1) } increment(#UsedThread) CheckUser($next list item(%lst_Keywords)) wait(0.1) } define CheckUser(#_username) { thread { comment("This var is local you will not see it in the debugger unless you change it to be global. It should be local when you are not debugging.") set(#_returnedJson,$plugin function("HeopasCustom.dll", "$Heopas HTTP Get", "https://twitter.com/users/username_available?username={#_username}", "", "", "", "", ""),"Local") comment("This is where you add the users to a list At the end save that list to a file Don\'t try to save to a file within a thread Unless you can do it thread safe but that is a more advanced topic") decrement(#UsedThread) } } Quote Link to post Share on other sites
hecolivares 1 Posted October 12, 2017 Author Report Share Posted October 12, 2017 Thank you.... testing it now.. I´ll try and save to new list. No new browser needed? Quote Link to post Share on other sites
hecolivares 1 Posted October 13, 2017 Author Report Share Posted October 13, 2017 Also.... I was verifying available accounts through the browser message... basically using the if.... exists.....scrape attribute. Can you think of a way of internal verification? This will most likely speed up the process. Quote Link to post Share on other sites
hecolivares 1 Posted October 13, 2017 Author Report Share Posted October 13, 2017 I can see that you tried to adapt the code from the video and that you got a lot of things right but it does need to be rearranged. The most important thing to point out is that you need to have a main loop which is not inside of your thread. The thread should called from within your main loop. So I am going to write out the structure so that it is easier to see and then I'll fix your code.So here is the main structure: ui drop down("Thread Count","1,2,3,4,5",#threadCount) comment("Reset used threads on each run") set(#usedThreads,0,"Global") comment("Loop for the number of usernames you want to check") loop(#numberOfAccountsToCheck) { comment("Wait for an open thread") loop while($comparison(#usedThreads,">= Greater than or equal to",#threadCount)) { wait(1) } comment("Open a thread") increment(#usedThreads) comment("Call the thread") CoreOfYourProgram() wait(0.1) } define CoreOfYourProgram { thread { comment("This is where you check if the account is available") divider comment("Close the thread") decrement(#usedThreads) } }Now in order for yours to work properly I don't think using read file is going to be a good idea for this. It may work but I think you should use Heopas plugin instead (it's free). You will need to check for the availability and then add it to a list I put a comment where you can do that but this will get you 95% of the way and if you can't figure it out let me know: ui drop down("Set Number of Threads","1,2,3,4,5",#ThreadCount) ui block text("Users",#User list) ui save file("Available Twitter Users",#Available Twitter User File) ui stat monitor("Countdown to finish",#var_CYC_Keyword_CRT) clear list(%lst_Keywords) add list to list(%lst_Keywords,$list from text(#User list,$new line),"Delete","Global") set(#UsedThread,0,"Global") loop($list total(%lst_Keywords)) { loop while($comparison(#UsedThread,">= Greater than or equal to",#ThreadCount)) { wait(1) } increment(#UsedThread) CheckUser($next list item(%lst_Keywords)) wait(0.1) } define CheckUser(#_username) { thread { comment("This var is local you will not see it in the debugger unless you change it to be global. It should be local when you are not debugging.") set(#_returnedJson,$plugin function("HeopasCustom.dll", "$Heopas HTTP Get", "https://twitter.com/users/username_available?username={#_username}", "", "", "", "", ""),"Local") comment("This is where you add the users to a list At the end save that list to a file Don\'t try to save to a file within a thread Unless you can do it thread safe but that is a more advanced topic") decrement(#UsedThread) } } Also... the program crashes at 5 threads. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 15, 2017 Report Share Posted October 15, 2017 No need to use a browser, the plugin does a get request which eliminates the need for a browser altogether. I checked via fiddler and everything is working fine for me and no crashes. You have the latest version of the plugin installed and activated right?At this point you need to pass your proxy to the thread and then check the JSON response and add the user to a list. And since it's not too much to add in I'll add it in but I'm not going to test this thoroughly so you will have to do that to ensure it actually works properly. Basically if the JSON says valid is true then it will add that user to the available list. ui drop down("Set Number of Threads","1,2,3,4,5",#ThreadCount) ui block text("Users",#User list) ui block text("Proxies",#proxies) ui save file("Available Twitter Users",#Available Twitter User File) ui stat monitor("Countdown to finish",#var_CYC_Keyword_CRT) clear list(%proxies) add list to list(%proxies,$list from text(#proxies,$new line),"Delete","Global") clear list(%available) clear list(%lst_Keywords) add list to list(%lst_Keywords,$list from text(#User list,$new line),"Delete","Global") set(#UsedThread,0,"Global") loop($list total(%lst_Keywords)) { loop while($comparison(#UsedThread,">= Greater than or equal to",#ThreadCount)) { wait(1) } increment(#UsedThread) CheckUser($next list item(%lst_Keywords), $next list item(%proxies)) if($comparison($list position(%proxies),">= Greater than or equal to",$list total(%proxies))) { then { set list position(%proxies,0) } else { } } wait(0.1) } define CheckUser(#_username, #_proxy) { thread { comment("This var is local you will not see it in the debugger unless you change it to be global. It should be local when you are not debugging.") set(#_returnedJson,$plugin function("HeopasCustom.dll", "$Heopas HTTP Get", "https://twitter.com/users/username_available?username={#_username}", #_proxy, "", "", "", ""),"Local") if($comparison($find regular expression(#_returnedJson,"(?<=valid\\\"\\[a-zA-Z]+"),"=","true")) { then { add item to list(%available,#_username,"Don\'t Delete","Global") } else { comment("Username taken or error") } } decrement(#UsedThread) } } 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.