Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using custom bot list with basic or extended bot list #8

Open
smilesrg opened this issue Jun 3, 2015 · 3 comments
Open

Using custom bot list with basic or extended bot list #8

smilesrg opened this issue Jun 3, 2015 · 3 comments

Comments

@smilesrg
Copy link

smilesrg commented Jun 3, 2015

How can I use custom bot list together with basic or extended bot list?

@lennerd
Copy link
Owner

lennerd commented Jun 7, 2015

The use of custom meta data in combination of the vipx/bot-detector meta data files is a bit cumbersome, as this connection is kind of hacked into this bundle (take a look at: https://github.com/lennerd/VipxBotDetectBundle/blob/master/Config/MetadataFileLocator.php).

It's not easy to access the metadata files, because Symfony only is capable of resource links from one Bundle to another. So simply importing the meta data files from some kind of "not-bundle" library will not work here.
If you have any good ideas how to refactore the loading of the meta data files to enable use cases like yours, PRs are very welcome.

A possible solution would be to generate fixture files from external services (archives, other repositories, etc.). This feature would enable the VipxBotDetectBundle to register its own meta data folder and to load external data into this one. However this is not implemented yet, but something I have on the ToDo list for the vipx/bot-detector library.

Another solution I can think of would be to develop an own file path format for bot meta data files, which can be imported into your own files. But I would not like to add extra conding conventions not part of the current Symfony eco system.

@smilesrg
Copy link
Author

I've found a workaround:

#Importing extended list. You have to choose right path from the current directory to the library's file
imports:
     - { resource: '../../../../../../vendor/vipx/bot-detect/Vipx/BotDetect/Resources/metadata/extended.yml' }

#Custom bots
bots:
    amazon_client:
        agent: Google-HTTP-Java-Client
        ip: null
        type: bot

@lennerd
Copy link
Owner

lennerd commented Feb 13, 2016

Nice, thanks for sharing. Let's leave this open till we found a solution for loading custom meta data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants