FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
py4e/code2/twitter2.py at master · GHubPythonProjects/py4e · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
GHubPythonProjects
/
py4e
Public
forked from
csev/py4e
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
py4e
/
code2
/
twitter2.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (21 loc) · 657 Bytes
Breadcrumbs
py4e
/
code2
/
twitter2.py
Copy path
File metadata and controls
24 lines (21 loc) · 657 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import
urllib
import
twurl
import
json
TWITTER_URL
=
'https://api.twitter.com/1.1/friends/list.json'
while
True
:
print
''
acct
=
raw_input
(
'Enter Twitter Account:'
)
if
(
len
(
acct
)
<
1
) :
break
url
=
twurl
.
augment
(
TWITTER_URL
,
{
'screen_name'
:
acct
,
'count'
:
'5'
} )
print
'Retrieving'
,
url
connection
=
urllib
.
urlopen
(
url
)
data
=
connection
.
read
()
headers
=
connection
.
info
().
dict
print
'Remaining'
,
headers
[
'x-rate-limit-remaining'
]
js
=
json
.
loads
(
data
)
print
json
.
dumps
(
js
,
indent
=
4
)
for
u
in
js
[
'users'
] :
print
u
[
'screen_name'
]
s
=
u
[
'status'
][
'text'
]
print
' '
,
s
[:
50
]
Back
|
FazBrowse Home
|
New Git URL