Jump to content
UBot Underground

Recommended Posts

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 into

a 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. 

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Another example with Regex would be...

 

set(#Keywords file"fleas
I like a flea less Dog.
Cats and dogs get fleas.
Fleas bug me
fleas 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.")

Link to post
Share on other sites
  • 4 years later...

Is "Word Frequency command" part of the plugin?

 

Thanks

 

 

Luis Carlos

Word Frequency
http://content.screencast.com/users/lowridertj/folders/Snagit/media/dcfa70f6-90c1-4f54-9eb9-179792682473/01.07.2014-18.png

Download from
www.botguru.net/wp-content/downloads/plugins/FileFolderCommands.zip

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...