Rashmi Rai
Rashmi Rai

Reputation: 23

I'm using the twitter4j library to access the public twitter stream

I'm using the twitter4j library to access the public twitter stream. I'm trying to make a project involving geotagged tweets, and I need to collect a large number of them for testing.

Right now I am getting the unfiltered stream from twitter and only saving tweets with geotags. This is slow though because the VAST majority of tweets don't have geo tags. I want the twitter stream to send me only tweets with geotags.

I have tried using the method mentioned in [this question][1], where you filter with a bounding box of size 360* by 180* but that's not working for me. I'm not getting any errors when using that filter, but I'm still getting 99% of tweets with no geotags. Here is how I'm doing it:

    DefaultHttpClient httpclient = new DefaultHttpClient();
    httpclient.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
            new DefaultHttpMethodRetryHandler());
    HttpGet httpget = new HttpGet("https://developers.facebook.com/docs/reference/api/examples/");
    HttpResponse response = httpclient.execute(httpget);
    HttpEntity entity = response.getEntity();
    if (entity != null) {
        entity.consumeContent();
    }
    List<Cookie> cookies = httpclient.getCookieStore().getCookies();
    HttpPost httpost = new HttpPost(
    "https://www.facebook.com/login.php?login_attempt=1");
    List<NameValuePair> nvps = new ArrayList<NameValuePair>();
    nvps.add(new BasicNameValuePair("email", "xxxxxxxxxxxxxx"));
    nvps.add(new BasicNameValuePair("pass", "ssssssss"));
    httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
    response = httpclient.execute(httpost);
    entity = response.getEntity();
    if (entity != null) {
        entity.consumeContent();
    }
    CookieStore cookiestrore = httpclient.getCookieStore();
    //cookies = httpclient.getCookieStore().getCookies();
    //httpclient.getConnectionManager().shutdown();
    return cookiestrore;

Any this is not getting any error but i am not getting any results.

Upvotes: 0

Views: 450

Answers (1)

orbita
orbita

Reputation: 179

When you track keyword it is separate job from tracking locations. These are logical ORs

Upvotes: 0

Related Questions