Skip to content

Commit 4921058

Browse files
committed
Add script to update dojo stats in GitHub profile
1 parent f2ef926 commit 4921058

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

update_profile.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'net/http'
4+
require 'json'
5+
6+
BASE_URL = 'https://coderdojo.jp'
7+
DOJO_STATS = JSON.parse Net::HTTP.get(URI.parse "#{BASE_URL}/stats.json"), symbolize_names: true
8+
9+
profile = File.read('profile/README.md')
10+
profile.sub!(/日本全国(\d+)/, "日本全国#{DOJO_STATS[:active_dojos]}")
11+
12+
File.open('profile/README.md', 'w') do |file|
13+
file.write(profile)
14+
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy