Site icon StackBlogger

How to get real-time twitter data using Java

I will explain here how can you retrieve your Twitter post/data using JAVA (Net-beans).

Follow these steps-

  1. Download twitter4j —

Firstly you have to download a zip file of Twitter4j for getting the data. You can download from this –http://twitter4j.org after downloading you have to extract all files.

  1.  Create a twitter developer account —

    This is the link where you can create your developing account https://developer.twitter.com then create an application to get Consumer Key and Access token key which is to be used in your java Application.

  1.  Add twitter4j JAR files into your project library —

You can follow these steps for adding – Open your project / go to properties / select libraries / Add new JAR/ folder then navigate to that position where you download twitter4j jar files.

  1. Add following code into your App-

    You will see your posts are displayed at  Netbeans Console.

    Thanks.