Commit ·
5fc64f8
0
Parent(s):
feat: initial commit
Browse files- Gemfile +8 -0
- Gemfile.lock +66 -0
- LICENSE +21 -0
- README.md +81 -0
- main.rb +59 -0
- songs.jsonl +0 -0
Gemfile
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
source "https://rubygems.org"
|
| 4 |
+
|
| 5 |
+
# gem "rails"
|
| 6 |
+
|
| 7 |
+
gem "nokogiri", "~> 1.18"
|
| 8 |
+
gem "http", "~> 5.2"
|
Gemfile.lock
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GEM
|
| 2 |
+
remote: https://rubygems.org/
|
| 3 |
+
specs:
|
| 4 |
+
addressable (2.8.7)
|
| 5 |
+
public_suffix (>= 2.0.2, < 7.0)
|
| 6 |
+
base64 (0.2.0)
|
| 7 |
+
domain_name (0.6.20240107)
|
| 8 |
+
ffi (1.17.2-aarch64-linux-gnu)
|
| 9 |
+
ffi (1.17.2-aarch64-linux-musl)
|
| 10 |
+
ffi (1.17.2-arm-linux-gnu)
|
| 11 |
+
ffi (1.17.2-arm-linux-musl)
|
| 12 |
+
ffi (1.17.2-arm64-darwin)
|
| 13 |
+
ffi (1.17.2-x86_64-darwin)
|
| 14 |
+
ffi (1.17.2-x86_64-linux-gnu)
|
| 15 |
+
ffi (1.17.2-x86_64-linux-musl)
|
| 16 |
+
ffi-compiler (1.3.2)
|
| 17 |
+
ffi (>= 1.15.5)
|
| 18 |
+
rake
|
| 19 |
+
http (5.2.0)
|
| 20 |
+
addressable (~> 2.8)
|
| 21 |
+
base64 (~> 0.1)
|
| 22 |
+
http-cookie (~> 1.0)
|
| 23 |
+
http-form_data (~> 2.2)
|
| 24 |
+
llhttp-ffi (~> 0.5.0)
|
| 25 |
+
http-cookie (1.0.8)
|
| 26 |
+
domain_name (~> 0.5)
|
| 27 |
+
http-form_data (2.3.0)
|
| 28 |
+
llhttp-ffi (0.5.1)
|
| 29 |
+
ffi-compiler (~> 1.0)
|
| 30 |
+
rake (~> 13.0)
|
| 31 |
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
| 32 |
+
racc (~> 1.4)
|
| 33 |
+
nokogiri (1.18.8-aarch64-linux-musl)
|
| 34 |
+
racc (~> 1.4)
|
| 35 |
+
nokogiri (1.18.8-arm-linux-gnu)
|
| 36 |
+
racc (~> 1.4)
|
| 37 |
+
nokogiri (1.18.8-arm-linux-musl)
|
| 38 |
+
racc (~> 1.4)
|
| 39 |
+
nokogiri (1.18.8-arm64-darwin)
|
| 40 |
+
racc (~> 1.4)
|
| 41 |
+
nokogiri (1.18.8-x86_64-darwin)
|
| 42 |
+
racc (~> 1.4)
|
| 43 |
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
| 44 |
+
racc (~> 1.4)
|
| 45 |
+
nokogiri (1.18.8-x86_64-linux-musl)
|
| 46 |
+
racc (~> 1.4)
|
| 47 |
+
public_suffix (6.0.2)
|
| 48 |
+
racc (1.8.1)
|
| 49 |
+
rake (13.2.1)
|
| 50 |
+
|
| 51 |
+
PLATFORMS
|
| 52 |
+
aarch64-linux-gnu
|
| 53 |
+
aarch64-linux-musl
|
| 54 |
+
arm-linux-gnu
|
| 55 |
+
arm-linux-musl
|
| 56 |
+
arm64-darwin
|
| 57 |
+
x86_64-darwin
|
| 58 |
+
x86_64-linux-gnu
|
| 59 |
+
x86_64-linux-musl
|
| 60 |
+
|
| 61 |
+
DEPENDENCIES
|
| 62 |
+
http (~> 5.2)
|
| 63 |
+
nokogiri (~> 1.18)
|
| 64 |
+
|
| 65 |
+
BUNDLED WITH
|
| 66 |
+
2.6.2
|
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2025 sevenc7c
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
- config_name: default
|
| 4 |
+
features:
|
| 5 |
+
- name: url
|
| 6 |
+
dtype: string
|
| 7 |
+
- name: title
|
| 8 |
+
dtype: string
|
| 9 |
+
- name: composer
|
| 10 |
+
dtype: string
|
| 11 |
+
|
| 12 |
+
- name: past_level
|
| 13 |
+
dtype: int32
|
| 14 |
+
- name: past_notes
|
| 15 |
+
dtype: int32
|
| 16 |
+
- name: past_floors
|
| 17 |
+
dtype: int32
|
| 18 |
+
- name: past_longs
|
| 19 |
+
dtype: int32
|
| 20 |
+
- name: past_arcs
|
| 21 |
+
dtype: int32
|
| 22 |
+
- name: past_skys
|
| 23 |
+
dtype: int32
|
| 24 |
+
|
| 25 |
+
- name: present_level
|
| 26 |
+
dtype: int32
|
| 27 |
+
- name: present_notes
|
| 28 |
+
dtype: int32
|
| 29 |
+
- name: present_floors
|
| 30 |
+
dtype: int32
|
| 31 |
+
- name: present_longs
|
| 32 |
+
dtype: int32
|
| 33 |
+
- name: present_arcs
|
| 34 |
+
dtype: int32
|
| 35 |
+
- name: present_skys
|
| 36 |
+
dtype: int32
|
| 37 |
+
|
| 38 |
+
- name: future_level
|
| 39 |
+
dtype: int32
|
| 40 |
+
- name: future_notes
|
| 41 |
+
dtype: int32
|
| 42 |
+
- name: future_floors
|
| 43 |
+
dtype: int32
|
| 44 |
+
- name: future_longs
|
| 45 |
+
dtype: int32
|
| 46 |
+
- name: future_arcs
|
| 47 |
+
dtype: int32
|
| 48 |
+
- name: future_skys
|
| 49 |
+
dtype: int32
|
| 50 |
+
|
| 51 |
+
- name: beyond_level
|
| 52 |
+
dtype: int32
|
| 53 |
+
- name: beyond_notes
|
| 54 |
+
dtype: int32
|
| 55 |
+
- name: beyond_floors
|
| 56 |
+
dtype: int32
|
| 57 |
+
- name: beyond_longs
|
| 58 |
+
dtype: int32
|
| 59 |
+
- name: beyond_arcs
|
| 60 |
+
dtype: int32
|
| 61 |
+
- name: beyond_skys
|
| 62 |
+
dtype: int32
|
| 63 |
+
|
| 64 |
+
- name: eternal_level
|
| 65 |
+
dtype: int32
|
| 66 |
+
- name: eternal_notes
|
| 67 |
+
dtype: int32
|
| 68 |
+
- name: eternal_floors
|
| 69 |
+
dtype: int32
|
| 70 |
+
- name: eternal_longs
|
| 71 |
+
dtype: int32
|
| 72 |
+
- name: eternal_arcs
|
| 73 |
+
dtype: int32
|
| 74 |
+
- name: eternal_skys
|
| 75 |
+
dtype: int32
|
| 76 |
+
---
|
| 77 |
+
|
| 78 |
+
# Arcaea Num Notes Dataset
|
| 79 |
+
|
| 80 |
+
[wikiwikiのノート数](https://wikiwiki.jp/arcaea/%E3%83%8E%E3%83%BC%E3%83%84%E6%95%B0%E9%A0%86)をもとにしたデータセット。
|
| 81 |
+
収集コードはmain.rbを参照してください。
|
main.rb
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
require "nokogiri"
|
| 3 |
+
require "http"
|
| 4 |
+
require "json"
|
| 5 |
+
|
| 6 |
+
url = "https://wikiwiki.jp/arcaea/%E3%83%8E%E3%83%BC%E3%83%84%E6%95%B0%E9%A0%86"
|
| 7 |
+
response = HTTP.get(url)
|
| 8 |
+
doc = Nokogiri.HTML(response.body.to_s)
|
| 9 |
+
contents = doc.at_css("div#content").children
|
| 10 |
+
tables =
|
| 11 |
+
contents
|
| 12 |
+
.drop_while { |node| !(node.at_css("a[name='n000']")) }
|
| 13 |
+
.take_while { |node| !node.at_css("a[name='notesbylevel']") }
|
| 14 |
+
|
| 15 |
+
diff = {
|
| 16 |
+
"Past" => :past,
|
| 17 |
+
"Present" => :present,
|
| 18 |
+
"Future" => :future,
|
| 19 |
+
"Eternal" => :eternal,
|
| 20 |
+
"Beyond" => :beyond
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
def parse_num_notes(num_notes)
|
| 24 |
+
return 0 if num_notes == "-"
|
| 25 |
+
num_notes.to_i
|
| 26 |
+
end
|
| 27 |
+
|
| 28 |
+
songs = Hash.new { |h, k| h[k] = {} }
|
| 29 |
+
tables
|
| 30 |
+
.flat_map { |t| t.css("tbody tr") }
|
| 31 |
+
.each do |tr|
|
| 32 |
+
s_notes, n_song, composer, r_diff, s_lv, s_f, s_l, s_a, s_s = tr.css("td")
|
| 33 |
+
|
| 34 |
+
notes = s_notes.text.strip.to_i
|
| 35 |
+
song = n_song.text.strip
|
| 36 |
+
song_url = n_song.at_css("a")["href"]
|
| 37 |
+
composer = composer.text.strip
|
| 38 |
+
difficulty = diff[r_diff.text.strip]
|
| 39 |
+
level = s_lv.text.strip.to_i
|
| 40 |
+
num_floors = parse_num_notes(s_f.text.strip)
|
| 41 |
+
num_longs = parse_num_notes(s_l.text.strip)
|
| 42 |
+
num_arcs = parse_num_notes(s_a.text.strip)
|
| 43 |
+
num_skys = parse_num_notes(s_s.text.strip)
|
| 44 |
+
songs[song_url][:title] = song
|
| 45 |
+
songs[song_url][:composer] = composer
|
| 46 |
+
|
| 47 |
+
songs[song_url][:"#{difficulty}_level"] = level
|
| 48 |
+
songs[song_url][:"#{difficulty}_notes"] = notes
|
| 49 |
+
songs[song_url][:"#{difficulty}_floors"] = num_floors
|
| 50 |
+
songs[song_url][:"#{difficulty}_longs"] = num_longs
|
| 51 |
+
songs[song_url][:"#{difficulty}_arcs"] = num_arcs
|
| 52 |
+
songs[song_url][:"#{difficulty}_skys"] = num_skys
|
| 53 |
+
end
|
| 54 |
+
|
| 55 |
+
File.open("songs.jsonl", "w") do |f|
|
| 56 |
+
songs.each do |url, song|
|
| 57 |
+
f.puts({ url: "https://wikiwiki.jp" + url }.merge(song).to_json)
|
| 58 |
+
end
|
| 59 |
+
end
|
songs.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|