TWTRSearchTimelineDataSource Class Reference
Inherits from | NSObject |
---|---|
Conforms to | TWTRTimelineDataSource |
Declared in | TWTRSearchTimelineDataSource.h |
Overview
Data source representing a Search Timeline. Provides TWTRTweet objects to a TWTRTimelineViewController in pages determined by the TWTRTimelineCursor object passed in to the loadNext:
and loadPrevious:
methods.
Search Queries:
watching now
containing both “watching” and “now”. Default.“happy hour”
containing the exact phrase “happy hour”.love OR hate
containing either “love” or “hate” (or both).beer -root
containing “beer” but not “root”.#haiku
containing the hashtag “haiku”.from:alexiskold
sent from person “alexiskold”.to:techcrunch
sent to person “techcrunch”.@mashable
referencing person “mashable”.flight :(
containing “flight” and with a negative attitude.traffic ?
containing “traffic” and asking a question.movie -scary :)
containing “movie”, but not “scary”, and with a positive attitude.hilarious filter:links
containing “hilarious” and linking to URL.news source:twitterfeed
containing “news” and entered via TwitterFeedsuperhero since:2010-12-27
containing “superhero” and sent since date “2010-12-27” (year-month-day).ftw until:2010-12-27
containing “ftw” and sent before the date “2010-12-27”.
searchQuery
The search query. This matches what you would type into https://twitter.com/search
@property (nonatomic, copy, readonly) NSString *searchQuery
Declared In
TWTRSearchTimelineDataSource.h
languageCode
Restricts tweets returned to a given language, specified by its ISO 639-1 code (for example: en, es). Language detection is best-effort. The server defaults to returning Tweets in all languages.
@property (nonatomic, copy, readonly, nullable) NSString *languageCode
Declared In
TWTRSearchTimelineDataSource.h
maxTweetsPerRequest
The number of Tweets to request in each network request for more Tweets. By default requests 30 tweets. If set to 0
the parameter will not be set on the request and the Twitter API will use the default size for the endpoint.
@property (nonatomic, readonly) NSUInteger maxTweetsPerRequest
Declared In
TWTRSearchTimelineDataSource.h
geocodeSpecifier
The geocode details to narrow search results. The format is “latitude,longitude,radius” e.g. “37.781157,-122.398720,1mi”
@property (nonatomic, copy, nullable) NSString *geocodeSpecifier
Declared In
TWTRSearchTimelineDataSource.h
filterSensitiveTweets
Filter out sensitive (containing nudity or violence) tweets.
@property (nonatomic) BOOL filterSensitiveTweets
Discussion
Defaults to YES.
Declared In
TWTRSearchTimelineDataSource.h
– initWithSearchQuery:APIClient:
Convenience initializer. Uses default values for languageCode
and maxTweetsPerRequest
.
- (instancetype)initWithSearchQuery:(NSString *)searchQuery APIClient:(TWTRAPIClient *)client
Parameters
searchQuery |
(required) The query string that you would type into https://twitter.com/search |
---|---|
client |
(required) An instance of |
Return Value
A fully initialized search timeline datasource or nil
if any of the required parameters are missing.
Declared In
TWTRSearchTimelineDataSource.h
– initWithSearchQuery:APIClient:languageCode:maxTweetsPerRequest:resultType:
Create a new search timeline data source.
- (instancetype)initWithSearchQuery:(NSString *)searchQuery APIClient:(TWTRAPIClient *)client languageCode:(nullable NSString *)languageCode maxTweetsPerRequest:(NSUInteger)maxTweetsPerRequest resultType:(nullable NSString *)resultType
Parameters
searchQuery |
(required) The query string that you would type into https://twitter.com/search |
---|---|
client |
(required) An instance of |
languageCode |
(optional) The ISO 639-1 language code to restrict Tweets to. A |
maxTweetsPerRequest |
(optional) The number of tweets to request in each query to the Twitter API. A value of 0 will not add to the parameters and thus use the server default. |
resultType |
(optional) The result type for timeline. It is default to ‘mixed’ if not assigned. |
Return Value
A fully initialized search timeline datasource or nil
if any of the required parameters are missing.
Declared In
TWTRSearchTimelineDataSource.h