Archive

Archive for the ‘Social Web’ Category

How to Set Up Twitter4J Quickly in Your Java Project

1. Go to http://twitter4j.org/en/index.html and download the most recently stable version.

2. Add twitter4j-core-2.2.5.jar into project for general use. If you want to use streaming API, add twitter4j-stream-2.2.5.jar into your project.

3. Copy Twitter API property file into your project/bin directory.

4. Test your code example:

public static void main(String[] args) throws Exception {

        Twitter twitter = new TwitterFactory().getInstance();
        int hits = twitter.getRateLimitStatus().getRemainingHits();
        System.out.println(hits);
        Status status = twitter.updateStatus("Really weird!");
        System.out.println("Successfully updated the status to ["
                + status.getText() + "].");

}

Advertisements
Categories: Social Web Tags:

The Organization of Social Posts

Observations:

1. Twitter

A typical tweet has the following attributes:

  • Author, associated with a  profile which includes: unique ID, screen name, location, portrait, following and followers, etc;
  • Tweet, including tweet content, time stamp, etc;
  • Attributes: favorite (like/dislike), retweet, reply.

image

2. Forum

Take http://stackoverflow.com as an example.

image

Attributes:

  • Agree (upper triangle) and disagree (lower triangle);
  • Favorite (star);
  • Share to Facebook and Twitter;
  • Tags such as “ruby”;
  • Author demographic data;
  • Replies.

3. News Article Review

Take Readwriteweb.com as an example.

An initial post is actually an article, so it contains title, (abstract), pictures/videos, and a long textual content. The following is what you can do for the initial post:

  • Share: Twitter, Facebook, Email, Digg and Print out.
  • Comments
  • Subscribe to the author or category.

image

If a post is a reply, it looks like this:

image

Attributes for such a reply post:

  • Author;
  • Content;
  • Time stamp;
  • Like/dislike;
  • Reply.

Modelling:

A general post model:

1. Each post has an unique URL, reallocated, to indicate the structures of the whole discussion thread. For example,

twitter/3456/23/1

means a post which is the first reply to post twitter/3456/23 and the latter is the 23rd post to the initial post twitter/3456 in Twitter.com.

2. Authors, with demographic data, are connected by social networks;

3. Posts can be organized by semantic ties, which indicates the cohesive of the topic (like hashtags in Twitter);

4. Time stamps are important in time series analysis.

Categories: Social Web