kekzilla 0 Posted January 4, 2014 Report Share Posted January 4, 2014 Hi guys, I made a bot that scrapes descriptions from google play for a set number of apps based on a keyword that I choose. I then take all the descriptions and combine them intoa single variable. What I want to do is perform a word frequency analysis and spit out a file with the # of times each word has been seen ordered from top to bottom. Also ignoring words less than 3 characters etc.. I'm fairly new to ubot. I have the dev version. I can probably figure out most of it on my own but I am not completely familiar with all the options yet so I am wondering if someone can point me in the right direction and let me know if this is doable with uBot? For now I am exporting the variable to a file and copying that and pasting it into a web program that does the word frequency for me. I'd like to be able to do everything in uBot. Quote Link to post Share on other sites
JDJ 1 Posted January 4, 2014 Report Share Posted January 4, 2014 It's definitely doable.. you can use the find index command to find the index of each piece of text under text functions. Find the first piece of text with find index, then get the substring from the end of the word (the index found + the length of the word) and find the next index within the substring and so on until you cannot find the word in the substring. Quote Link to post Share on other sites
JDJ 1 Posted January 4, 2014 Report Share Posted January 4, 2014 You could also just use Javascript and a regex - built this from a result on the first page of Google: navigate("http://www.ubotstudio.com/resources", "Wait") alert($eval("var word = \'Ubot\'; var text = document.body.innerHTML; var regex = new RegExp ( word+\'(?=[\\\\s.,;—)\"”\\\\\'-]+)\', \'gi\'); text.match(regex).length;")) Gets the count for a specific word - Ubot in this case. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 7, 2014 Report Share Posted January 7, 2014 Or you can check this out... http://www.ubotstudio.com/forum/index.php?/topic/14896-count-instances/ Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 7, 2014 Report Share Posted January 7, 2014 Another example with Regex would be... set(#Keywords file, "fleasI like a flea less Dog.Cats and dogs get fleas.Fleas bug mefleas are blood suckers", "Global")clear list(%flea list)add list to list(%flea list, $list from text($find regular expression(#Keywords file, "fleas|Fleas"), $new line), "Don\'t Delete", "Global")ui stat monitor($list total(%flea list), " occurrences of your word.") Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 7, 2014 Report Share Posted January 7, 2014 Testing a function (from a plugin i put together) to help you with this now. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 7, 2014 Report Share Posted January 7, 2014 Word Frequencyhttp://content.screencast.com/users/lowridertj/folders/Snagit/media/dcfa70f6-90c1-4f54-9eb9-179792682473/01.07.2014-18.pngDownload fromwww.botguru.net/wp-content/downloads/plugins/FileFolderCommands.zip 2 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 11, 2014 Report Share Posted January 11, 2014 it's beautiful TJ Quote Link to post Share on other sites
beatngu 65 Posted January 12, 2014 Report Share Posted January 12, 2014 That is a nice little plugin,thanks for sharing TJ Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 12, 2014 Report Share Posted January 12, 2014 anytime. Quote Link to post Share on other sites
jamesfar 15 Posted January 13, 2014 Report Share Posted January 13, 2014 You rock TJ. As always Quote Link to post Share on other sites
luis carlos 94 Posted March 13, 2018 Report Share Posted March 13, 2018 Is "Word Frequency command" part of the plugin? Thanks Luis CarlosWord Frequencyhttp://content.screencast.com/users/lowridertj/folders/Snagit/media/dcfa70f6-90c1-4f54-9eb9-179792682473/01.07.2014-18.pngDownload fromwww.botguru.net/wp-content/downloads/plugins/FileFolderCommands.zip 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.