Creating your own import type

DataGrab has the ability to import other kinds of data than default types that it comes bundled with (CSV, JSON, Wordpress, and XML).

To add a custom data type add add the folder "datagrab_datatypes" in the addons directory at the same level as your "datagrab" add-on folder. For example:

Your datatype class will need to extend the AbstractDataType class. At minimum it will need to implement the fetch() and next() methods.

<?php

class Datagrab_twitter extends AbstractDataType
{
    public function fetch()
    {
    }

    public function next()
    {
    }
}

Now when you go to the DataGrab module you should have an extra option in the “Create new import” menu.

Last updated

Was this helpful?