[英]twitter4j get tweets by GeoLocation
我有一個任務,我需要使用Geo Location的twitter4j獲取推文,有關OAuth和令牌的所有信息我都正確完成,但是當我試圖創建查詢時,方法geoCode();
了問題geoCode();
在編譯過程中出現錯誤:
Error:(148, 60) java: cannot find symbol
symbol: method geoCode(twitter4j.GeoLocation,double,java.lang.String)
location: class javax.management.Query
我不明白怎么了...
我的查詢代碼:
double lat = 59.4372155;
double lon = 24.7453688;
double res = 5;
String resUnit = "mi";
QueryResult result = twitter.search(new Query().geoCode(new GeoLocation(lat,lon),res, resUnit));
如果您需要更多代碼,請告訴我哪一部分,我將更新帖子
嘗試先將其分解並從那里開始:
Query query = new Query().geoCode(new GeoLocation(lat,lon), res, resUnit);
query.count(11); //You can also set the number of tweets to return per page, up to a max of 100
QueryResult result = twitter.search(query);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.