Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Commit

Permalink
TFJ-639 add with_twitter_user_id=true to search api query to get real…
Browse files Browse the repository at this point in the history
… user id
  • Loading branch information
yusuke committed Oct 20, 2011
1 parent 00c7ea9 commit 3d663fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions twitter4j-core/src/main/java/twitter4j/Query.java
Expand Up @@ -426,6 +426,7 @@ public Query resultType(String resultType) {
appendParameter("geocode", geocode, params);
appendParameter("until", until, params);
appendParameter("result_type", resultType, params);
appendParameter("with_twitter_user_id", "true", params);
HttpParameter[] paramArray = new HttpParameter[params.size()];
return params.toArray(paramArray);
}
Expand Down
3 changes: 2 additions & 1 deletion twitter4j-core/src/test/java/twitter4j/SearchAPITest.java
Expand Up @@ -115,6 +115,7 @@ public void testSearch() throws Exception {
query.setSinceId(1671199128);
queryResult = unauthenticated.search(query);
assertTrue(0 < queryResult.getTweets().size());
assertEquals(6358482, queryResult.getTweets().get(0).getFromUserId());

query = new Query("\\u5e30%u5e30 <%}& foobar").rpp(100).page(1);
QueryResult result = twitter1.search(query);
Expand All @@ -139,7 +140,7 @@ public void testTrends() throws Exception {
private void assertTrends(List<Trends> trendsArray, int expectedSize) throws Exception {
Date trendAt = null;
for (Trends singleTrends : trendsArray) {
assertTrue((expectedSize-10) < singleTrends.getTrends().length);
assertTrue((expectedSize - 10) < singleTrends.getTrends().length);
if (trendAt != null) {
assertTrue(trendAt.before(singleTrends.getTrendAt()));
}
Expand Down

0 comments on commit 3d663fa

Please sign in to comment.