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 nowcontaining both “watching” and “now”. Default.“happy hour”containing the exact phrase “happy hour”.love OR hatecontaining either “love” or “hate” (or both).beer -rootcontaining “beer” but not “root”.#haikucontaining the hashtag “haiku”.from:alexiskoldsent from person “alexiskold”.to:techcrunchsent to person “techcrunch”.@mashablereferencing 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:linkscontaining “hilarious” and linking to URL.news source:twitterfeedcontaining “news” and entered via TwitterFeedsuperhero since:2010-12-27containing “superhero” and sent since date “2010-12-27” (year-month-day).ftw until:2010-12-27containing “ftw” and sent before the date “2010-12-27”.
Tasks
-
searchQueryproperty -
languageCodeproperty -
maxTweetsPerRequestproperty -
geocodeSpecifierproperty -
topTweetsOnlyproperty -
filterSensitiveTweetsproperty -
– initWithSearchQuery:APIClient: -
– initWithSearchQuery:APIClient:languageCode:maxTweetsPerRequest: -
– init
Properties
filterSensitiveTweets
Filter out sensitive (containing nudity or violence) tweets.
@property (nonatomic) BOOL filterSensitiveTweetsDiscussion
Defaults to YES.
Declared In
TWTRSearchTimelineDataSource.hgeocodeSpecifier
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 *geocodeSpecifierDeclared In
TWTRSearchTimelineDataSource.hlanguageCode
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 *languageCodeDeclared In
TWTRSearchTimelineDataSource.hmaxTweetsPerRequest
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 maxTweetsPerRequestDeclared In
TWTRSearchTimelineDataSource.hsearchQuery
The search query. This matches what you would type into https://twitter.com/search
@property (nonatomic, copy, readonly) NSString *searchQueryDeclared In
TWTRSearchTimelineDataSource.hInstance Methods
initWithSearchQuery:APIClient:
Convenience initializer. Uses default values for languageCode and maxTweetsPerRequest.
- (instancetype)initWithSearchQuery:(NSString *)searchQuery APIClient:(TWTRAPIClient *)clientParameters
- searchQuery
(required) The query string that you would type into https://twitter.com/search
- client
(required) An instance of
TWTRAPIClientwith which API calls will be made.
Return Value
A fully initialized search timeline datasource or nil if any of the required parameters are missing.
Declared In
TWTRSearchTimelineDataSource.hinitWithSearchQuery:APIClient:languageCode:maxTweetsPerRequest:
Create a new search timeline data source.
- (instancetype)initWithSearchQuery:(NSString *)searchQuery APIClient:(TWTRAPIClient *)client languageCode:(nullable NSString *)languageCode maxTweetsPerRequest:(NSUInteger)maxTweetsPerRequestParameters
- searchQuery
(required) The query string that you would type into https://twitter.com/search
- client
(required) An instance of
TWTRAPIClientwith which API calls will be made.
- languageCode
(optional) The ISO 639-1 language code to restrict Tweets to. A
nilvalue will not add the parameter to the server request and so use the server default.
- 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.
Return Value
A fully initialized search timeline datasource or nil if any of the required parameters are missing.
Declared In
TWTRSearchTimelineDataSource.h