File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ def decorate_repository(repository)
7676 resource2hash ( repository ) . merge! \
7777 'composer' => composer ,
7878 'readme' => readme ,
79+ 'views' => download_unique_views ( repository ) ,
7980 'top_contributor' => download_top_contributor ( repository ) ,
8081 'emoji' => parse_emojis ( repository . description )
8182 end
@@ -99,6 +100,13 @@ def download_readme_references(repository)
99100 print_repo_error repository , 'Readme not found.'
100101 end
101102
103+ def download_unique_views ( repository )
104+ @client . views (
105+ repository . full_name ,
106+ accept : Octokit ::Preview ::PREVIEW_TYPES [ :traffic ]
107+ ) [ :uniques ]
108+ end
109+
102110 def download_top_contributor ( repository )
103111 resource2hash repository . rels [ :contributors ] . get . data . first
104112 end
Original file line number Diff line number Diff line change @@ -14,10 +14,13 @@ layout: page
1414 %th Stars
1515 %th Version
1616 %th Monthly downloads
17+ %th
18+ %abbr (title ='Unique views past 14 days' ) Views
1719 %th Build
1820 %th Coverage
1921 %th Style
20- %th BDFL
22+ %th
23+ %abbr (title ='Main contributor' ) BDFL
2124{% for repo in set %}
2225 %tbody
2326 %tr
@@ -33,6 +36,8 @@ layout: page
3336 %td
3437 %a (href ='https://packagist.org/packages/{{ repo.composer.name }}/stats' )
3538 %img (src ='https://poser.pugx.org/{{ repo.composer.name }}/d/monthly' )
39+ %td
40+ {{ repo.views }}
3641 %td <
3742 {% if repo.readme['Build'] %}
3843 %a (href ='{{ repo.readme[' Build '].url }}' )
Original file line number Diff line number Diff line change @@ -199,6 +199,10 @@ form {
199199 padding : 20px ;
200200}
201201
202+ abbr {
203+ text-decoration : none;
204+ }
205+
202206/*******************************************************************************
203207Full-Width Styles
204208*******************************************************************************/
You can’t perform that action at this time.
0 commit comments