Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Data (1.0)

Percy Mamedy edited this page Mar 11, 2017 · 1 revision

Dealing with input

The Package accepts as its input an array of contentItems. Each Content Item is essentially an array with content, userid, sourceid and so on...

The content required, field is the content

       /*
        |--------------------------------------------------------------------------
        | id [string] | (Optional)
        |--------------------------------------------------------------------------
        |
        | A unique identifier for this content item
        |
        */

        'id' => '',

        /*
        |--------------------------------------------------------------------------
        | content [string] | (Required)
        |--------------------------------------------------------------------------
        |
        | A maximum of 20 MB of content to be analyzed
        |
        */

        'content' => '',

        /*
        |--------------------------------------------------------------------------
        | userid [string] | (Optional)
        |--------------------------------------------------------------------------
        |
        | A unique identifier for the author of this content
        |
        */

        'userid' => '',

        /*
        |--------------------------------------------------------------------------
        | sourceid [string] | (Optional)
        |--------------------------------------------------------------------------
        |
        | An identifier for the source of this content; for example, blog123 or twitter
        |
        */

        'sourceid' => '',

        /*
        |--------------------------------------------------------------------------
        | created [integer] | (Optional)
        |--------------------------------------------------------------------------
        |
        | When was the content created, UNIX Timestamp
        |
        */

        'created' => '',

        /*
        |--------------------------------------------------------------------------
        | updated [integer] | (Optional)
        |--------------------------------------------------------------------------
        |
        | When was the content updated, UNIX Timestamp
        |
        */

        'updated' => '',

        /*
        |--------------------------------------------------------------------------
        | contenttype [string] | (Optional)
        |--------------------------------------------------------------------------
        |
        | The MIME type of the content: Defaults to text/plain
        | - text/plain
        | - text/html
        |
        */

        'contenttype' => '',

        /*
        |--------------------------------------------------------------------------
        | language [string] | (Optional)
        |--------------------------------------------------------------------------
        |
        | The language of the content as a two-letter ISO 639-1
        | identifier: Defaults to en
        | - ar (Arabic)
        | - en (English, the default)
        | - es (Spanish)
        | - ja (Japanese)
        | Regional variants are treated as their parent
        | language; for example, en-US is interpreted
        | as en.
        |
        */

        'language' => '',

        /*
        |--------------------------------------------------------------------------
        | parentid [string] | (Optional)
        |--------------------------------------------------------------------------
        | 
        | The unique ID of the parent content item for this item. Used to
        | identify hierarchical relationships between posts/replies,
        | messages/replies, and so on.
        |
        */

        'parentid' => '',

        /*
        |--------------------------------------------------------------------------
        | reply [boolean] | (Optional)
        |--------------------------------------------------------------------------
        | 
        | Indicates whether this content item is a reply to another content item.
        |
        */
        
        'reply' => '',

        /*
        |--------------------------------------------------------------------------
        | forward [boolean] | (Optional)
        |--------------------------------------------------------------------------
        | 
        | Indicates whether this content item is a forwarded/copied version of
        | another content item.
        |
        */
        
        'forward' => ''