Mike D 0 Posted December 27, 2009 Report Share Posted December 27, 2009 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! Quote Link to post Share on other sites
Aaron Nimocks 19 Posted December 27, 2009 Report Share Posted December 27, 2009 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? Quote Link to post Share on other sites
Mike D 0 Posted December 27, 2009 Author Report Share Posted December 27, 2009 That works! Now I have to find out how to make the seach not case sensitive. Thanks a lot! Quote Link to post Share on other sites
tooltrainer 12 Posted December 27, 2009 Report Share Posted December 27, 2009 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 Quote Link to post Share on other sites
Aaron Nimocks 19 Posted December 27, 2009 Report Share Posted December 27, 2009 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. TrimingRemoving items from lists based off a keywordChange uppercase/lowercaseReversing list order Probably a ton of things I could do that could be useful. Quote Link to post Share on other sites
tooltrainer 12 Posted December 27, 2009 Report Share Posted December 27, 2009 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 Quote Link to post Share on other sites
some_guy 11 Posted December 27, 2009 Report Share Posted December 27, 2009 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. Quote Link to post Share on other sites
tooltrainer 12 Posted December 27, 2009 Report Share Posted December 27, 2009 Hey some_guy, when you hit "add reply" can you not just hit "back" to get your post back? I did this earlier as well and, at least in Firefox, my post was still there when I hit the back button... Jonathan Quote Link to post Share on other sites
Mike D 0 Posted December 28, 2009 Author Report Share Posted December 28, 2009 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 Quote Link to post Share on other sites
Guest Jim Posted December 28, 2009 Report Share Posted December 28, 2009 http://ubotstudio.com/forum/index.php?/topic/2205-library-strings/ Here's my string library. You could use the 'find' sub to check if a variable contains a piece of text. It returns -1 if the text is not found. Quote Link to post Share on other sites
Mike D 0 Posted December 28, 2009 Author Report Share Posted December 28, 2009 Jim when I use the find sub undefined is always returned. Any ideas? Quote Link to post Share on other sites
mdreier 0 Posted December 31, 2009 Report Share Posted December 31, 2009 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 indexofThis seemed to work fine the change:'{1}'.indexof('{2}') changed to '{1}'.search('{2}') Quote Link to post Share on other sites
Mike D 0 Posted December 31, 2009 Author Report Share Posted December 31, 2009 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 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.