# built documents.
#
# The short X.Y version.
-version = '0.9.0'
+version = '0.9.1'
# The full version, including alpha/beta/rc tags.
-release = '0.9.0'
+release = '0.9.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
\r
- ``PREFIX``: display string of prompt.\r
\r
+- ``SEARCH_TYPE``: search type in 'search' command ('mixed','recent','popular').\r
+\r
- ``SEARCH_MAX_RECORD``: max tweets can display on 'search' command.\r
\r
- ``HOME_TWEET_NUM``: default tweets to display on 'home' command.\r
"HIDE_PROMPT" : true,
// Prefix
"PREFIX" : "",
- // 'search': max search record
+ // 'search': search type ('mixed','recent','popular')
+ "SEARCH_TYPE" : "mixed",
+ // 'search': search max result, number over 100 will fallback to 100
"SEARCH_MAX_RECORD" : 5,
// 'home': default number of home's tweets
"HOME_TWEET_NUM" : 5,
Search
"""
t = Twitter(auth=authen())
- g['stuff'] = g['stuff'].strip()
- rel = t.search.tweets(q=g['stuff'])['statuses']
+ # Setup query
+ query = g['stuff'].strip()
+ type = c['SEARCH_TYPE']
+ if type not in ['mixed', 'recent', 'popular']:
+ type = 'mixed'
+ max_record = c['SEARCH_MAX_RECORD']
+ count = min(max_record, 100)
+ # Perform search
+ rel = t.search.tweets(
+ q=query,
+ type=type,
+ count=count
+ )['statuses']
+ # Return results
if rel:
printNicely('Newest tweets:')
- for i in reversed(xrange(c['SEARCH_MAX_RECORD'])):
- draw(t=rel[i],
- keyword=g['stuff'])
+ for i in reversed(xrange(count)):
+ draw(t=rel[i], keyword=query)
printNicely('')
else:
printNicely(magenta('I\'m afraid there is no result'))
import os.path
# Bumped version
-version = '0.9.0'
+version = '0.9.1'
# Require
install_requires = [