twitter4j - access tweet information from Streaming API

后端 未结 3 576
我在风中等你
我在风中等你 2021-02-01 11:01

My goal is to collect all tweets containing the words \"France\" and \"Germany\" and to also collect associated metadata (e.g., the geo coordinates attached to the tweet). I kno

3条回答
  •  走了就别回头了
    2021-02-01 11:37

    After looking at this with fresh eyes I realised the solution (which was pretty obvious). Editing the following part of the code:

    public void onStatus(Status status) {
            System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
        }
    

    allows me to access other metadata. For example, if I want to access the tweet's date, I simply need to add the following:

    System.out.println(status.getCreatedAt());
    

提交回复
热议问题