Jump to content
UBot Underground

"Contains" case sensitive


Recommended Posts

  • 2 weeks later...

Bump!

 

Also $replace appears to be case sensitive.

 

This has become a major pain in the arse as I am having to use javascript for everything which kind of defeats the purpose of using ubot.

Link to post
Share on other sites

Well there are a couple of ways. $contains--->either or regex.

 

I must say though I am kind of perplexed at the statement that having to use javascript all the time defeats the purpose of using UBot. That's kind of like saying my car runs on gas OR water, but if I have to keep using water I may as well swim there. I'm pretty certain that if you removed everything UBot from all of your javascript code you would be left with nothing functional.

Link to post
Share on other sites

HI John - great info - I didnt think of the either command for letters -

 

I have a bot which searches some text for #var1 - this is set by a user and will always change -

 

if #var1 is found then it will change it to a anchor text using a url from a list

 

say if a user was to type in

 

SEO services

or

SEO Services

or

Seo services

or

Seo Services etc.....

 

How could i do it then - The idea is to link to that keyword regardless of using upper or lower case -

 

thanks

Link to post
Share on other sites

Well there are a couple of ways. $contains--->either or regex.

 

I must say though I am kind of perplexed at the statement that having to use javascript all the time defeats the purpose of using UBot. That's kind of like saying my car runs on gas OR water, but if I have to keep using water I may as well swim there. I'm pretty certain that if you removed everything UBot from all of your javascript code you would be left with nothing functional.

 

My point was ubot has several features that should make life easy but there is simple problems with them that mean I have to write my own javascript functions instead of using them.

 

I don't agree with your water/car/swimming anology but I didn't come here to argue. Sorry I even asked...

Link to post
Share on other sites

HI John - great info - I didnt think of the either command for letters -

 

I have a bot which searches some text for #var1 - this is set by a user and will always change -

 

if #var1 is found then it will change it to a anchor text using a url from a list

 

say if a user was to type in

 

SEO services

or

SEO Services

or

Seo services

or

Seo Services etc.....

 

How could i do it then - The idea is to link to that keyword regardless of using upper or lower case -

 

thanks

 

 

 

Yeah, I see where that could cause problems. The pro version has the proper text constant which capitalizes the first letter of every word, but that still falls a little short as far as your example is concerned. I think if you take into consideration the potential for an anchor text phrase, I would have to believe that words like SEO would be among the minority. Most anchor text phrases are likely to be in the proper text format. However, it only takes one example (like SEO) to render the bot less than fully functional which obviously is NOT a desired outcome.

 

In order to use regex, you would have to code the bot to set regex strings dynamically, and while not impossible, that would be a LONG way to go to solve that one issue.

 

While I was writing this I was testing something...check it out

 

text_case.ubot

 

 

That is VERY interesting.

 

enter the search term seo services (all lowercase)...it works for this example...if you remove the set command it does not.

 

 

Link to post
Share on other sites

My point was ubot has several features that should make life easy but there is simple problems with them that mean I have to write my own javascript functions instead of using them.

 

I don't agree with your water/car/swimming anology but I didn't come here to argue. Sorry I even asked...

 

It's great that you asked! And I would never disagree that there some limitations. And this opened up a discussion conducive to solving some issues. But, the fact you are ABLE to integrate javascript into your UBot coding is a huge benefit.

 

Unfortunately Seth can't implement every upgrade or feature request, or he would do just that. So we work with what we have and help each other work through whatever stumbling blocks we may come across. Whatever you don't stop posting...thay's what this forum is for.

 

 

 

Link to post
Share on other sites

 

That is VERY interesting.

 

enter the search term seo services (all lowercase)...it works for this example...if you remove the set command it does not.

 

I entered in lower case but it didn't work (i.e. no alert). Weird thing is if I leave the box blank it evalutes as true and sends me to google and creates the alert box.

 

I have a bot which searches some text for #var1 - this is set by a user and will always change -

 

if #var1 is found then it will change it to a anchor text using a url from a list

 

say if a user was to type in

 

SEO services

or

SEO Services

or

Seo services

or

Seo Services etc.....

 

How could i do it then - The idea is to link to that keyword regardless of using upper or lower case -

 

Not sure I followed exactly what you are trying to achieve but this bot might do the trick.

replace (noncase sensitive).ubot

Link to post
Share on other sites

I am guessing it returned true because it was able to find nothing (blank space) on the page. But what I found interesting is that when you change the lowercase to all uppercase it worked even though it was not a match by case.

Link to post
Share on other sites

I am guessing it returned true because it was able to find nothing (blank space) on the page. But what I found interesting is that when you change the lowercase to all uppercase it worked even though it was not a match by case.

 

I can't re-create that effect. Is that because I only have standard version?

Link to post
Share on other sites

hi john - yeh that didnt seem to work for me but thanks for posting back

 

Guerrilla - im not sure i entirely understand your code - still a newbie :rolleyes:

 

anyway what i saw was that it was replacing the the word TEXT all upper case and you searched for it using lower case then replaced it with words - its great that is recognized the word - TEXT regardless of the the case however is there anyway we can implement this in the following code -

image attached

 

The #AnchorKeyword is a UI box which is the part we are checking for which requires the case sensative code we are trying to work out

 

thanks

 

abs

post-785-12945801640919_thumb.gif

Link to post
Share on other sites

That shouldn't matter...can you see the set node? (with $text to upper case)?

 

Yes, I can see the node.

 

Abs - ok, I will have a play with my code so you can use it to add link and anchor text

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