I would like to have rules integration for Browscap.

One day... it will be mine... Oh yes... It shall be mine...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

generalredneck’s picture

patchy patch patch

Let me know if you would rather this be a seperate module. I figure browscap is small enough that this additional functionality wouldn't be too much of a burden.

generalredneck’s picture

Jumped the gun... Forgot to add the getter callback to the other properties.

generalredneck’s picture

Status: Active » Needs review

and now status

generalredneck’s picture

Una Mas.

I found out that the "boolean" values stored in the array were actually text. This was unexpected... but I did make adjustments. In addition... I removed a debug watchdog that was in my last patches.

greggles’s picture

Can you describe a bit more why this is useful and any drawbacks it might have? My sense is that the only drawback is another ~50 lines of code, but if there is a performance/scalability impact that would be good to know about.

generalredneck’s picture

So in my case I need to keep certain browsers from hitting a specific page using backed code. Specifically I want search engines to be able to index some pages while other browsers hit a squeeze page. The reasoning for this is partly because of the functionality of the squeeze page relies on cookies but I also have to run a rule that sets a flag if I decided to let someone through.

With that said this achieves something that JavaScript is better at but let's me also perform the same tasks when JavaScript is not an option via rules as opposed to a custom module.

generalredneck’s picture

I realized I didn't answer your second question. As for scalability... I wish I didn't have to do the giant array. If there was some functionality in the existing module that determined the interface of the information... I wouldn't have to do it that way. Ideally there would be something somewhere defining all the properties a browser could have and the descriptions.this would allow the flexibility the ini file has and fulfil the needs for other information gathering hooks. As for performance... seems to be negligible in difference.

benjarlett’s picture

I want to capture the users browser information (i guess when they login a rule could be triggered so that the last known browser for that user would be logged...) and store it in their profile so that some of my users can view other users browser info without needing to ask them.... this sounds like it might well do it... is it working?

generalredneck’s picture

it's working on a production server for me with this patch. I use it to allow search bots through but redirect other people through a squeeze page on http://oakmotors.com/inventory

AohRveTPV’s picture

Issue summary: View changes

Probably a naive question, but why not just use robots.txt for your use case?

Is the issue that some crawlers ignore robots.txt? If so, couldn't they just spoof their user agent too?

AohRveTPV’s picture

Patch doesn't comply with Drupal coding standards, by the way. You could run through Coder Review on minor.

Also, some typos in the labels:
"tabel"
"broswer"
"controles"

generalredneck’s picture

As far as I know... this choke page that I created is the only way for a user to get to a page. If the user has not went through the choke page, then it hasn't been stored in their session that this has happened and any inventory page they go to will take them back to the choke page. This isn't a javascript side solution, otherwise, the bot wouldn't care because it doesn't parse Javascript anyway.

So basically if I didn't have a rule that said, "Hey I'm a search engine bot, don't make me go to the choke page" then the search engine bot would be 301ed back to the choke page for any links to any inventory or lists of inventory, making the inventory not indexable by the search engine... make sense?

I'll take a look at the patch.

AstonVictor’s picture

Status: Needs review » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks