<commit_before># Github Zeitgeist


## Overview

Github Zeitgeist is a Rails Web Application to show how different events changed what people code in a certain period of time.
It uses Github Archive (http://www.githubarchive.org/) and Google BigQuery (https://developers.google.com/bigquery/) to get the statistics.

Working example: github-zeitgeist.andresiglesias.net

## Install

1. Fork the project
2. If you don't already have one, sign up for a Google account: https://accounts.google.com/SignUp
3. Create a BigQuery enabled project via the Google Developers Console: https://console.developers.google.com/project
4. Generate a new OAuth Client Id of type "Service account"
5. Generate new P12 key, download it and place it in the following folder of the forked project 'config/keys/'.
6. Edit "bigquery.rb" in 'config/initializers' with the Service Account information just generated. Change the key_file, client_id and email.
7. Change your project number in the 'calculate' method in 'app/models/event.rb':
@project = XXXXX
You can get your project number in the overiew of your project in Google Developers Console.
8. Run 'rake db:setup'
9. Start the rails application
10. Press 'Generate statistics' in the index
11. Enjoy :)

## Add your own events

Adding your own events it's very simple. 

Go to 'db/seeds.rb'. 

You have an example already there. 

An event have the following form: 

```ruby
event = Event.new
event.title = Event title
event.description = A description of the event
event.media = A link to an image or video
event.media_attribution = The attribution to the used media
event.media_description = A caption that explains the used media
event.since = The event start date
event.until = The event end date
event.compare = 1: If you want to compare the selected period with the same period last month, 2: If you want to compare the selected dates with the same period last year
event.category = "Security"<commit_msg>Doc update 2<commit_after># Github Zeitgeist


## Overview

Github Zeitgeist is a Rails Web Application to show how different events changed what people code in a certain period of time.
It uses Github Archive (http://www.githubarchive.org/) and Google BigQuery (https://developers.google.com/bigquery/) to get the statistics.

Working example: github-zeitgeist.andresiglesias.net

## Install

1. Fork the project
2. If you don't already have one, sign up for a Google account: https://accounts.google.com/SignUp
3. Create a BigQuery enabled project via the Google Developers Console: https://console.developers.google.com/project
4. Generate a new OAuth Client Id of type "Service account"
5. Generate new P12 key, download it and place it in the following folder of the forked project 'config/keys/'.
6. Edit "bigquery.rb" in 'config/initializers' with the Service Account information just generated. Change the key_file, client_id and email.
7. Change your project number in the 'calculate' method in 'app/models/event.rb':
@project = XXXXX
You can get your project number in the overiew of your project in Google Developers Console.
8. Run 'rake db:setup'
9. Start the rails application
10. Press 'Generate statistics' in the index
11. Enjoy :)

## Add your own events

Adding your own events it's very simple. 

Go to 'db/seeds.rb'. 

You have an example already there. 

An event have the following form: 

```ruby
event = Event.new
event.title = Event title
event.description = A description of the event
event.media = A link to an image or video
event.media_attribution = The attribution to the used media
event.media_description = A caption that explains the used media
event.since = The event start date
event.until = The event end date
event.compare = 1: If you want to compare the selected period with the same period last month, 2: If you want to compare the selected dates with the same period last year
event.category = A category for the event
{'fraction_non_alphanumeric': 0.0676056338028169, 'fraction_numerical': 0.008962868117797696, 'mean_word_length': 4.285520974289581, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6551002', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1036, 'n_words': 549}