from oyster.tasks import ExternalStoreTask
from superfastmatch import Client

class SuperFastMatchTask(ExternalStoreTask):

    external_store = 'superfastmatch'
    sfm_client = Client('http://ec2-174-129-105-103.compute-1.amazonaws.com/')

    def upload_document(self, doc_id, filedata, metadata):
        # from {state}.fulltext import extract_text
        extract_text = __import__('%s.fulltext' % metadata['state'],
                                  fromlist=['extract_text']).extract_text
        _id = int(time.time()*10000)
        extracted = extract_text(filedata, metadata)
        self.sfm_client.add(1, id, filedata, defer=True,
                            **metadata)
        return _id

@@ -1,12 +1,24 @@
+import sys%0A%0A
 from oyster.
@@ -83,16 +83,109 @@
 Client%0A%0A
+from billy.conf import settings%0A%0Afor p in settings.SCRAPER_PATHS:%0A    sys.path.insert(0, p)%0A%0A
 class Su

use scraper paths to load fulltext module