Database Reference
In-Depth Information
Query query = new Query("apress");
QueryResult result = connection.search(query);
6.
Let's store these tweets on a local folder:
final String filePath = "tweets"; // you may
change it as per your configuration
File file = new File(filePath);
FileOutputStream fos = null;
try
{
fos = new FileOutputStream(file);
}
catch (FileNotFoundException e)
{
// log error
}
// read and write tweets on local file system
do
{
List<Status> statuses =
result.getTweets();
for (Status status : statuses)
{
StringBuilder sb = new
StringBuilder();
sb.append(status.getUser().getCreatedAt());
sb.append("\001");
if (status.getUser() !=
null)
{
sb.append(status.getUser().getName());
sb.append("\001");
}
Search WWH ::




Custom Search