Jump to content
UBot Underground

Can you search for text in a variable?


Recommended Posts

I need to be able to check a variable to see if it contains a word within it and then set another varible to yes or no. I'm unsure if this is possible.

 

Does anybody have any recommendations?

 

Thanks!

Link to post
Share on other sites

Only way I can think to do this is browse to a text box anywhere. For instance go to google. Fill in the search box with your variable. Then do an If -> Search Page = $variable then set your variable.

 

Make since?

Link to post
Share on other sites

Incidentally, there could be cases where you want to do a lot of analysis of scraped data in a more controlled fashion, and one way to do this would be to create your own page that you control somewhere, that is set up with fields to accept certain pieces of data... so you populate those fields and then can analyze their contents.

 

This ties in somewhat with my thread on Ubot + PHP integration. I think combining Ubot with pages we control ourselves for various functions, could be a real knockout.

 

Jonathan

Link to post
Share on other sites

This ties in somewhat with my thread on Ubot + PHP integration. I think combining Ubot with pages we control ourselves for various functions, could be a real knockout.

 

If I ever get time (which could be awhile) I might throw together a PHP page and upload it to share. But a page with a bunch of functions on it would rock.

 

Triming

Removing items from lists based off a keyword

Change uppercase/lowercase

Reversing list order

 

Probably a ton of things I could do that could be useful.

Link to post
Share on other sites

You got it Aaron! There are certain data processing things that are just better suited to PHP than they are UBot... so having a PHP page with a ton of commonly used functions on it, that we could pass data to from UBot and retrieve the results, would be freaking AMAZING. Parsing csv data, image processing, database integration, hell even integrating with existing scripts like Wordpress, Joomla, or anything else.

 

The possibilities once you combine the two, are pretty much endless. UBot for the front end, and PHP for the backend. What a monster. And if you set up the back end stuff yourself, you could distribute compiled bots that use your "remote library" without the user even knowing about it soetof like a remotely included .js library. So you could have sensitive data that UBot needs to do its job, but you don't want an outsourcer for example to know about. Keep the sensitive data on your server and just have UBot get what it needs as it's needed without the user ever seeing it.

 

So cool...

 

Jonathan

Link to post
Share on other sites

arghh just lost my reply by clicking "add reply" instead of "post".

 

Anyway, you could do this using the string library Jim posted on the old board (if it made the port).

 

There was a substring function, that returned the position of the string found, would be easy to change so it returned true or false (1 or 0).

 

Looks like you know your way around programming languages, but if having any difficulties, let me know and i can send you the sub.

Link to post
Share on other sites

Great idea! I never thought of that. while I don't program in PHP I'm Okay in Coldfusion. I could create a page to handle many function that we don't have with UBot and create some database functionality also. I see the potential.

 

Thanks for your inspiration Jonathan

Link to post
Share on other sites

Jim when I use the find sub undefined is always returned.

 

Any ideas?

 

I had the same problem. I made a new sub that was identical to 'find' but I used the search command instead of indexof

This seemed to work fine

 

the change:

'{1}'.indexof('{2}') changed to '{1}'.search('{2}')

Link to post
Share on other sites

That worked like a charmed. I Googled javascript and tried to fix it myself but I must of had the wrong syntax. I didn't put the '' around the variables.

 

I can see where knowing some javascript can be a big help with UBot.

 

Thanks for the help

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