Skip to content

Commit 4c30c45

Browse files
committed
Add sample script to fetch dojo linked text #1433
1 parent 7325cbe commit 4c30c45

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

get_dojo_linked_text.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'net/http'
4+
require 'json'
5+
require 'pry'
6+
7+
uri = URI.parse('https://coderdojo.jp/dojos.json')
8+
dojos = JSON.parse(Net::HTTP.get uri)
9+
result = "<ul>\n"
10+
#pp dojos
11+
#binding.pry
12+
13+
dojos.sample(5).each do |d|
14+
result << " <li>#{d['linked_text']}</li>\n"
15+
end
16+
result << "</ul>\n"
17+
18+
puts result

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