本文整理汇总了Java中com.twitter.sdk.android.core.models.Search类的典型用法代码示例。如果您正苦于以下问题:Java Search类的具体用法?Java Search怎么用?Java Search使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Search类属于com.twitter.sdk.android.core.models包,在下文中一共展示了Search类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: success
import com.twitter.sdk.android.core.models.Search; //导入依赖的package包/类
@Override
public void success(Result<Search> result) {
final List<Tweet> tweets = result.data.tweets;
final TimelineResult<Tweet> timelineResult
= new TimelineResult<>(new TimelineCursor(tweets), tweets);
if (cb != null) {
cb.success(new Result<>(timelineResult, result.response));
}
}
示例2: success
import com.twitter.sdk.android.core.models.Search; //导入依赖的package包/类
@Override
public void success(Result<Search> result) {
if (result.data.tweets.size() > 0) {
rv.setAdapter(new TweetsAdapter(result.data));
vgMutex.showView(rv);
}
else {
TextView tv = (TextView) vgMutex.findViewById(R.id.tv_no_tweets);
tv.setText(getString(R.string.fmt_message_no_tweets, hashtag));
vgMutex.showView(tv);
}
}
示例3: createSearchRequest
import com.twitter.sdk.android.core.models.Search; //导入依赖的package包/类
Call<Search> createSearchRequest(final Long sinceId, final Long maxId) {
return twitterCore.getApiClient().getSearchService().tweets(query, geocode,
languageCode, null, resultType, maxItemsPerRequest, untilDate, sinceId, maxId,
true);
}
示例4: doSearch
import com.twitter.sdk.android.core.models.Search; //导入依赖的package包/类
private void doSearch() {
final Call<Search> search = client.getSearchService()
.tweets(hashtag, null, null, null, null, 50, null, null, null, true);
search.enqueue(new SearchCallback());
}
示例5: TweetsAdapter
import com.twitter.sdk.android.core.models.Search; //导入依赖的package包/类
public TweetsAdapter(Search search) {
this.search = search;
}
示例6: tweets
import com.twitter.sdk.android.core.models.Search; //导入依赖的package包/类
/**
* Returns a collection of relevant Tweets matching a specified query.
* <p>
* Please note that Twitter's search service and, by extension, the Search API is not meant to
* be an exhaustive source of Tweets. Not all Tweets will be indexed or made available via the
* search interface.
* <p>
* In API v1.1, the response format of the Search API has been improved to return Tweet objects
* more similar to the objects you'll find across the REST API and platform. You may need to
* tolerate some inconsistencies and variance in perspectival values (fields that pertain to the
* perspective of the authenticating user) and embedded user objects.
* <p>
* To learn how to use Twitter Search effectively, consult our guide to Using the Twitter Search
* API. See Working with Timelines to learn best practices for navigating results by since_id
* and max_id.
*
* @param query (required) A UTF-8, URL-encoded search query of 500 characters maximum,
* including operators. Queries may additionally be limited by complexity.
* @param geocode (optional) Returns tweets by users located within a given radius of the given
* latitude/longitude. The location is preferentially taking from the Geotagging
* API, but will fall back to their Twitter profile. The parameter value is
* specified by "latitude,longitude,radius", where radius units must be specified
* as either "mi" (miles) or "km" (kilometers). Note that you cannot use the near
* operator via the API to geocode arbitrary locations; however you can use this
* geocode parameter to search near geocodes directly. A maximum of 1,000
* distinct "sub-regions" will be considered when using the radius modifier.
* @param lang (optional) Restricts tweets to the given language, given by an ISO 639-1 code.
* Language detection is best-effort.
* @param locale (optional) Specify the language of the query you are sending (only ja is
* currently effective). This is intended for language-specific consumers and the
* default should work in the majority of cases.
* @param resultType (optional) Specifies what type of search results you would prefer to
* receive. The current default is "mixed." Valid values include:
* mixed: Include both popular and real time results in the response.
* recent: return only the most recent results in the response
* popular: return only the most popular results in the response.
* @param count (optional) The number of tweets to return per page, up to a maximum of 100.
* Defaults to 15. This was formerly the "rpp" parameter in the old Search API.
* @param until (optional) Returns tweets generated before the given date. Date should be
* formatted as YYYY-MM-DD. Keep in mind that the search index may not go back as
* far as the date you specify here.
* @param sinceId (optional) Returns results with an ID greater than (that is, more recent than)
* the specified ID. There are limits to the number of Tweets which can be
* accessed through the API. If the limit of Tweets has occured since the
* since_id, the since_id will be forced to the oldest ID available.
* @param maxId (optional) Returns results with an ID less than (that is, older than) or equal
* to the specified ID.
* @param includeEntities (optional) The entities node will be disincluded when set to false.
*/
@GET("/1.1/search/tweets.json?" +
"tweet_mode=extended&include_cards=true&cards_platform=TwitterKit-13")
Call<Search> tweets(@Query("q") String query,
//EncodedQuery protects commas from encode
@Query(value = "geocode", encoded = true) Geocode geocode,
@Query("lang") String lang,
@Query("locale") String locale,
@Query("result_type") String resultType,
@Query("count") Integer count,
@Query("until") String until,
@Query("since_id") Long sinceId,
@Query("max_id") Long maxId,
@Query("include_entities") Boolean includeEntities);