├── .gitignore ├── LICENSE ├── README.md ├── assets ├── css │ ├── app.css │ └── material-dashboard.min.css └── js │ ├── bootstrap-material-design.min.js │ ├── jquery.min.js │ ├── material-dashboard.min.js │ ├── perfect-scrollbar.jquery.min.js │ └── popper.min.js ├── data ├── follower.txt ├── following.txt ├── num_github_users.txt ├── num_github_users_followers.txt ├── num_github_users_repo.txt ├── num_repo.txt └── num_stars.txt ├── global.html ├── img ├── pages.png ├── scope.png ├── screenshot.png └── sidebar.png ├── index.html ├── init.sh ├── ok.sh └── script.sh /.gitignore: -------------------------------------------------------------------------------- 1 | profile.txt 2 | 3 | # Others 4 | .DS_Store 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, Iskandar Setiadi 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github Profile Visualizer 2 | 3 | Visualize Github profile growth (followers, num repo, rank based on followers or num repo) with daily cron and Github Pages. 4 | 5 | Available via Github Pages - [https://freedomofkeima.github.io/github-profile-visualizer/](https://freedomofkeima.github.io/github-profile-visualizer/). 6 | 7 | ![](img/screenshot.png) 8 | 9 | ## Make Your Own Github Pages 10 | 11 | Github provides a free, static page websites via [Github Pages](https://pages.github.com/). In order to start using it, you need to: 12 | 13 | * Fork this repo. 14 | * Open your repo setting and scroll down to Github Pages. Change your `source` and save. Your setup should look like below. 15 | 16 | ![Enable github pages for this project](img/pages.png) 17 | 18 | * Clone your repo to your computer and run `sh init.sh GITHUB_USERNAME GITHUB_TOKEN`. Read the guide below on how to generate your token. 19 | * Install `jq`. You can either use `sudo yum install jq` or `sudo apt-get install jq`, depending on your distro. 20 | * Run `sh script.sh` (or `./script.sh`) to update and upload your data. Add cron job integration (explained below) to automatically update your repository everyday. 21 | * Check if it works, visit `https://[GITHUB_USERNAME].github.io/github-profile-visualizer/`. 22 | 23 | 24 | ## Github Personal Access Token 25 | 26 | To access Github, we need to create a personal access token. 27 | 28 | Access [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new) to generate a new personal token. 29 | 30 | 31 | We need to set the following 3 scopes: 32 | 33 | ``` 34 | "scopes": [ 35 | "public_repo", 36 | "repo:status", 37 | "read:user" 38 | ] 39 | ``` 40 | 41 | ![Scope](img/scope.png) 42 | 43 | `public_repo` is used to allow us committing daily cron changes back to the repository, while `repo:status` is used to get number of repositories, and `read:user` is used to get number of followers & followings. 44 | 45 | ## ok.sh 46 | 47 | `ok.sh` is adapted from [whiteinge/ok.sh](https://github.com/whiteinge/ok.sh), which has BSD 3-Clause. 48 | 49 | As of October 3, 2018, `ok.sh` doesn't support `list_followers` and `list_following`. Therefore, `ok.sh` in this repository is a freezed version with modifications. 50 | 51 | We will store "Personal Access Token" that you have retrieved above in `$HOME/.netrc`. See `init.sh` for details implementation. 52 | 53 | For other optional configurations, consult to [whiteinge/ok.sh#configuration](https://github.com/whiteinge/ok.sh#configuration). 54 | 55 | ## script.sh 56 | 57 | Assuming your repository clone is located at `$HOME`, you can try running `script.sh` manually via: 58 | 59 | ``` 60 | $ GITHUB_USER=[YOUR_USERNAME] GITHUB_TOKEN=[YOUR_TOKEN] $HOME/github-profile-visualizer/script.sh 61 | ``` 62 | 63 | ## Adding cron job 64 | 65 | At this point, you should be able to see a new commit in your repository, congrats! 66 | 67 | The next step is, we want to automate the job. You can add the following line to your crontab (`crontab -e`): 68 | 69 | ``` 70 | 0 10 * * * GITHUB_USER=[YOUR_USERNAME] GITHUB_TOKEN=[YOUR_GENERATED_TOKEN] $HOME/github-profile-visualizer/script.sh &>/dev/null 71 | ``` 72 | 73 | Feel free to adjust the parameter above (schedule, source path, etc) based on your configuration. 74 | 75 | ## Contributors 76 | 77 | - [Iskandar Setiadi](https://github.com/freedomofkeima) 78 | - [Tegar Imansyah](https://github.com/tegarimansyah) 79 | 80 | ## License 81 | 82 | This project is licensed under BSD 3-Clause. 83 | -------------------------------------------------------------------------------- /assets/css/app.css: -------------------------------------------------------------------------------- 1 | .ct-chart { 2 | max-width: 250px; 3 | } 4 | 5 | @media (min-width: 576px) { 6 | .ct-chart { 7 | max-width: 400px; 8 | } 9 | } 10 | 11 | @media (min-width: 768px) { 12 | .ct-chart { 13 | max-width: 300px; 14 | } 15 | } 16 | 17 | @media (min-width: 992px) { 18 | .ct-chart { 19 | max-width: 275px; 20 | } 21 | } 22 | 23 | @media (min-width: 1200px) { 24 | .ct-chart { 25 | max-width: 400px; 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /assets/js/material-dashboard.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ========================================================= 3 | Material Dashboard - v2.1.1 4 | ========================================================= 5 | 6 | Product Page: https://www.creative-tim.com/product/material-dashboard 7 | Copyright 2019 Creative Tim (https://www.creative-tim.com) 8 | Licensed under MIT (https://github.com/creativetimofficial/material-dashboard/blob/master/LICENSE.md) 9 | 10 | Coded by Creative Tim 11 | 12 | ========================================================= 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.*/ 15 | 16 | isWindows=-1');0!=$("body").find(".main-panel").length?e.appendTo(".main-panel"):$("body").hasClass("off-canvas-sidebar")&&e.appendTo(".wrapper-full-page"),setTimeout(function(){e.addClass("visible")},100),e.click(function(){$("html").removeClass("nav-open"),mobile_menu_visible=0,e.removeClass("visible"),setTimeout(function(){e.remove(),$toggle.removeClass("toggled")},400)}),$("html").addClass("nav-open"),mobile_menu_visible=1}}),$(window).resize(function(){md.initSidebarsCheck(),seq=seq2=0,setTimeout(function(){md.initDashboardPageCharts()},500)}),md={misc:{navbar_menu_visible:0,active_collapse:!0,disabled_collapse_init:0},checkSidebarImage:function(){$sidebar=$(".sidebar"),image_src=$sidebar.data("image"),void 0!==image_src&&(sidebar_container='