Filter accounts in crawl update

Introduction
=========
When you configure a ThinkUp installation with so many Twitter and Facebook Pages instances, you need  somehow to cut your crawl update for:
* running some instances update at the same time
* cutting your updates in time

Changes
=======
So we have added two new parameters for crawl.php:
* THINKUP_CRAWL_FILTER = Sets the number of partitions to divide all the accounts to be crawled
* THINKUP_CRAWL_SELECTED = Sets the partition that will be updated in this crawl run

These parameters are optional, if not present the crawl run like before. There are no changes when running crawl update from the web.

We have added a mutex for admin users when using filters to crawl update

Example
=======
<code>0 6 * * * cd /var/www/html/thinkup/crawler/;export THINKUP_PASSWORD=*****;export THINKUP_CRAWL_FILTER=10;export THINKUP_CRAWL_SELECTED=0; php crawl.php seca-sistemes@tv3.cat</code>
<code>0 7 * * * cd /var/www/html/thinkup/crawler/;export THINKUP_PASSWORD=*****;export THINKUP_CRAWL_FILTER=10;export THINKUP_CRAWL_SELECTED=1; php crawl.php seca-sistemes@tv3.cat </code>

File Changes
==========
* webapp/_lib/class.CrawlFilter.php: Add CrawlFilter class to cache cron parameters used by crawl in SessionCache
* webapp/_lib/class.PluginRegistrarCrawler.php: Add mutex for admin user when using filters in crawl update
* webapp/_lib/controller/class.CrawlerAuthController.php: Added two new parameters for crawl controller
* webapp/_lib/dao/class.InstanceMySQLDAO.php: Implement new FilteredInstanceDAO interface
* webapp/_lib/dao/interface.FilteredInstanceDAO.php: New interface
* tests/TestOfCrawlFilter.php: Add tests for CrawlFilter
* tests/TestOfCrawlerAuthController.php: Add tests for CrawlerAuthController
* tests/TestOfInstanceMySQLDAO.php: Add tests for TestOfInstanceMySQLDAO
* tests/all_model_tests.php: Add TestOfCrawlFilter in all_model_tests



Powered by Televisió de Catalunya / Universitat Illes Balears -
SOCIALMEDIA PROJECT - CEN-20101037 - This contribution has been kindly
sponsored by the Centro para el Desarrollo Tecnológico Industrial within
the Programa de Investigación Nacional Español CENIT. -
http://www.cenitsocialmedia.es/