Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to have rules integration for Browscap.
One day... it will be mine... Oh yes... It shall be mine...
Comment | File | Size | Author |
---|---|---|---|
#4 | browscap-rules_integration-2064679-4.patch | 5.93 KB | generalredneck |
#2 | browscap-rules_integration-2064679-2.patch | 5.79 KB | generalredneck |
#1 | browscap-rules_integration-2064679-1.patch | 4.05 KB | generalredneck |
Comments
Comment #1
generalredneckpatchy 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.
Comment #2
generalredneckJumped the gun... Forgot to add the getter callback to the other properties.
Comment #3
generalredneckand now status
Comment #4
generalredneckUna 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.
Comment #5
gregglesCan 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.
Comment #6
generalredneckSo 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.
Comment #7
generalredneckI 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.
Comment #8
benjarlett CreditAttribution: benjarlett commentedI 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?
Comment #9
generalredneckit'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
Comment #10
AohRveTPV CreditAttribution: AohRveTPV commentedProbably 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?
Comment #11
AohRveTPV CreditAttribution: AohRveTPV commentedPatch 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"
Comment #12
generalredneckAs 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.
Comment #13
AstonVictor CreditAttribution: AstonVictor at DevBranch commentedI'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