Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
9a959513
Commit
9a959513
authored
Aug 11, 2014
by
kjwon15
Browse files
Handling message "friends" on streaming.
parent
c9a7ba3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
9a959513
...
...
@@ -58,6 +58,9 @@ class StreamListener(object):
status
=
Status
.
parse
(
self
.
api
,
data
)
if
self
.
on_direct_message
(
status
)
is
False
:
return
False
elif
'friends'
in
data
:
if
self
.
on_friends
(
data
[
'friends'
])
is
False
:
return
False
elif
'limit'
in
data
:
if
self
.
on_limit
(
data
[
'limit'
][
'track'
])
is
False
:
return
False
...
...
@@ -87,6 +90,13 @@ class StreamListener(object):
"""Called when a new direct message arrives"""
return
def
on_friends
(
self
,
friends
):
"""Called when a friends list arrives.
friends is a list that contains user_id
"""
return
def
on_limit
(
self
,
track
):
"""Called when a limitation notice arrvies"""
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment