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
6e19c6fb
Commit
6e19c6fb
authored
Oct 12, 2014
by
jozef-mitro
Browse files
Fix sample to use Requests instead of httplib
parent
4de8d077
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
6e19c6fb
...
...
@@ -307,13 +307,13 @@ class Stream(object):
self
.
url
=
'/%s/statuses/retweet.json'
%
STREAM_VERSION
self
.
_start
(
async
)
def
sample
(
self
,
async
=
False
,
language
=
None
):
def
sample
(
self
,
async
=
False
,
languages
=
None
):
self
.
session
.
params
=
{
'delimited'
:
'length'
}
if
self
.
running
:
raise
TweepError
(
'Stream object already connected!'
)
self
.
url
=
'/%s/statuses/sample.json?delimited=length'
%
STREAM_VERSION
if
language
:
self
.
url
+=
'&language=%s'
%
language
self
.
parameters
[
'language'
]
=
language
self
.
url
=
'/%s/statuses/sample.json'
%
STREAM_VERSION
if
languages
:
self
.
session
.
params
[
'language'
]
=
','
.
join
(
map
(
str
,
languages
))
self
.
_start
(
async
)
def
filter
(
self
,
follow
=
None
,
track
=
None
,
async
=
False
,
locations
=
None
,
...
...
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