Line 4: |
Line 4: |
| }} | | }} |
| | | |
− | The bots are written in Perl, but it's relatively independent of the Product Opener code base, similar scripts could be written in pretty much any language. | + | The bots are written in Perl or in Ruby, but it's relatively independent of the Product Opener code base, similar scripts could be written in pretty much any language. |
| The bot uses both the mongodb database and the perl binary files that stores the product data, but you could just use the mongodb data only, it's the same. | | The bot uses both the mongodb database and the perl binary files that stores the product data, but you could just use the mongodb data only, it's the same. |
| + | |
| + | =Writing bots in Perl = |
| + | =Writing bots in Ruby = |
| + | <pre> |
| + | gem install openfoodfacts |
| + | </pre> |
| + | * Example that adds parent brands: https://github.com/openfoodfacts/openfoodfacts-corrector |
| + | = Writing bots in Python = |
| + | = Testing bots = |
| + | * Please test bots on world.openfoodfacts.net |
| + | * Please ask for permission to use the bot on Slack before you switch to .org |
| + | |
| =Checkbot= | | =Checkbot= |
− |
| |
| Checkbot is a little bot that will check Open Food Facts for obvious errors and report them on Slack, in the [https://openfoodfacts.slack.com/messages/bots/ #bots] channel. | | Checkbot is a little bot that will check Open Food Facts for obvious errors and report them on Slack, in the [https://openfoodfacts.slack.com/messages/bots/ #bots] channel. |
| == Code == | | == Code == |
− | [https://bitbucket.org/openfoodfacts/product-opener/src/3f2b4c2790d19ad559fb68376001d4dbc7cd34a5/cgi/checkbot.pl?at=master Code on bitbucket] | + | * Language: Perl |
| + | * [https://bitbucket.org/openfoodfacts/product-opener/src/3f2b4c2790d19ad559fb68376001d4dbc7cd34a5/cgi/checkbot.pl?at=master Code on bitbucket] |
| == Current checks == | | == Current checks == |
| * It checks if one of the nutrients has a value higher than 105g for 100g / 100ml. | | * It checks if one of the nutrients has a value higher than 105g for 100g / 100ml. |
Line 28: |
Line 40: |
| Fixbot removed bogus countries that appeared at some point in the products, due to a Product Opener bug | | Fixbot removed bogus countries that appeared at some point in the products, due to a Product Opener bug |
| Product http://world.openfoodfacts.org/product/8414606446629 (miel-quot-esencia-andalusi-quot / esencia-andalusi) : removing bogus countries, replacing with Spain | | Product http://world.openfoodfacts.org/product/8414606446629 (miel-quot-esencia-andalusi-quot / esencia-andalusi) : removing bogus countries, replacing with Spain |
| + | == Code == |
| + | * Language: Perl |
| == Ideas == | | == Ideas == |
| <pre> | | <pre> |
Line 54: |
Line 68: |
| UPCBot was used to normalize UPC codes. Since we now normalize them in Product Opener, it should not be used anymore. | | UPCBot was used to normalize UPC codes. Since we now normalize them in Product Opener, it should not be used anymore. |
| [[Category:ProductOpener]][[Category:Bots]] | | [[Category:ProductOpener]][[Category:Bots]] |
| + | == Code == |
| + | * Language: Perl |
| | | |
| = Ideas for new bots = | | = Ideas for new bots = |
| * tacite [10:10 PM] New bot idea : Getting notifications for new complete products by contributors that have less than 5 completed products. That way we know we have to control it thoroughly | | * tacite [10:10 PM] New bot idea : Getting notifications for new complete products by contributors that have less than 5 completed products. That way we know we have to control it thoroughly |