Commits and comments with emotions are good for your health 😄
Have a look at http://zunda.github.io/emoticommits/. The map shows commits and comments of GitHub users, along with their avatars, or, better than those, emoticons 😃 from commit messages or comments. Please note that not all activities are shown.
The idea of showing acitivities on a world map heavily comes from the late Hello world! - greetings to the planet by which showed greetings from Twitter users real time. The big difference seems to be that the GitHub users do not care much if it is day ☀️ or night 🌔
A server runs record_activity.rb as an hourly cron job that parses hourly JSON file from GitHub Archive. The process extracts events from the JSON file, queries GitHub API when needed, and stores them into an SQLite3 database. It seems that about half of events can be queired within the limited time - meaning that not all activities are shown on the map. Queries are shuffled before executed so events are distributed evenly in the time period. Afterwards, it looks up GitHub users' locations from GeoCoding results stored in another SQLite3 database, and queries the Google Geocoding API up to 100 locaitons, so that queries will be within the rate limit of 2,500/day.
The map loads a JSON file of markers thorugh markers.js, which show commits or comments along with users' location, every hour on 50 minutes.
As the map shows evetns of either 24 hours ago or 7 days ago, JSON files of markers for 23 hours ago and 7 days minus 1 hour ago are created, by [create_markers.rb] (bin/create_markers.rb) as another cron job, from the local databases every hour and automatically committed and pushed to the GitHub pages.
The map shows day and night areas through sun.js. The JavaScript calculates direction (latitude and longitude) of the Sun on the earth and creates paths, as great cicles on the Earth surface, for the night shade divided into four areas. A google.maps.Polygon
converts the great circles onto the Mercator map with the geodesic: true
option.
Please see the LICENSE file.