Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Guest User
/
general
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7ac9bfa0
authored
Oct 12, 2017
by
jijins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First changes
1 parent
aaf1d7f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
search.py
search.py
0 → 100644
View file @
7ac9bfa
#!/usr/local/bin/python
import
urllib2
import
json
search_q
=
'playframework'
url
=
'https://api.github.com/search/repositories?q=
%
s&sort=stars&order=desc'
%
search_q
response
=
urllib2
.
urlopen
(
url
)
result
=
json
.
loads
(
response
.
read
())
items
=
result
[
'items'
]
languages
=
[]
count
=
0
stargazers_count
=
0
print
"URL DESCIPTION"
print
"-----------------------------------------------------------------------------"
for
item
in
items
:
count
+=
1
stargazers_count
+=
item
[
'stargazers_count'
]
if
item
[
'language'
]
not
in
languages
:
languages
.
append
(
item
[
'language'
])
print
item
[
"html_url"
],
" "
,
item
[
"description"
]
print
"-----------------------------------------------------------------------------"
print
"Unique list of programming languages:-"
,
","
.
join
(
languages
)
print
"Average star rating:-"
,
stargazers_count
/
count
Write
Preview
Markdown
is supported
Attach a file
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 post a comment