2channel

Updated on Friday, 30 March, 2012 - 17:24

A Note for Developers

When you write external code for 2channel, bear in mind that some languages (including Java and PHP) cannot handle variable names that start with a number.

If you write purely in CSDL, you do not need to take any special precautions. If you write external code using DataSift's client libraries, the libraries will handle the issue for you (as they use the array notation) so, again, you do not need to take any additional action.

However, if you write external code that hits a DataSift API directly, be aware that you must take extra care. For example, in PHP you might avoid the problem by changing this code:

    $obj->2ch->author->name

to this code:

    $xyz = "2ch";
    $obj->{$xyz}->author->name

or this code:

    $obj->{'2ch'}->author->name

An alternative approach is to work in array notation rather than object notation, to ensure that you avoid problems:

    $interaction['2ch']['author']['name'];

Name Type Contents
2ch.author.name string

The real name supplied by the author of a post.

2ch.content string

The text of a 2ch post.

2ch.contenttype string

Currently this is always set to "HTML".

2ch.link string

A link to an original post.

2ch.thread string

A link to a complete message board thread.

2ch.title string

The title of a post.

2ch.type string

Indicates whether a post contains the first message in a new thread.