maimai_net 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a9649c531c49ff62f1391875bcce1cf77c46b93e563c673afe188a688066f2d7
4
+ data.tar.gz: 60436b79e63a417b1a11dd636d988c4c48a5ce7fd7ccf6b469754399ac2a322f
5
+ SHA512:
6
+ metadata.gz: d084e5b1969ee15a674c717415faa9eb358ac929e14d4e2c29e59bac212d81d0882382a436a5adf46384dcc2294bc31e0ac18fcf7c603169e8df8f97658c1c44
7
+ data.tar.gz: 2043fa38bacd2f093e0ba60bbe2d45c036c1bfc50c1d9aac2f7aa385dbd219ca4ea7ee0dd77f3e14fa89c3d3d2c5af970044539d38970a14331563ad6c4f5684
@@ -0,0 +1,53 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ concurrency:
9
+ group: ${{ github.ref_name }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ build:
14
+ name: Build + Publish
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: read
18
+ packages: write
19
+ id-token: write
20
+ env:
21
+ RUBY_VERSION: '2.7'
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Ruby ${{ env.RUBY_VERSION }}
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ bundler-cache: true
28
+ ruby-version: ${{ env.RUBY_VERSION }}
29
+ # Publish
30
+ - name: Publish to GPR
31
+ run: |
32
+ mkdir -p $HOME/.gem
33
+ touch $HOME/.gem/credentials
34
+ chmod 0600 $HOME/.gem/credentials
35
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
36
+ gem build *.gemspec
37
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
38
+ env:
39
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
40
+ OWNER: ${{ github.repository_owner }}
41
+ - name: Publish to RubyGems
42
+ if: ${{ false }}
43
+ run: |
44
+ mkdir -p $HOME/.gem
45
+ touch $HOME/.gem/credentials
46
+ chmod 0600 $HOME/.gem/credentials
47
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
48
+ gem build *.gemspec
49
+ gem push *.gem
50
+ env:
51
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
52
+ - name: Publish to RubyGems (Trusted)
53
+ uses: rubygems/release-gem@v1
data/.gitignore ADDED
@@ -0,0 +1,165 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/ruby,rubymine+all,linux
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=ruby,rubymine+all,linux
3
+
4
+ ### Linux ###
5
+ *~
6
+ .*.swp
7
+
8
+ # temporary files which can be created if a process still has a handle open of a deleted file
9
+ .fuse_hidden*
10
+
11
+ # KDE directory preferences
12
+ .directory
13
+
14
+ # Linux trash folder which might appear on any partition or disk
15
+ .Trash-*
16
+
17
+ # .nfs files are created when an open file is removed but is still being accessed
18
+ .nfs*
19
+
20
+ ### Ruby ###
21
+ *.gem
22
+ *.rbc
23
+ /.config
24
+ /coverage/
25
+ /InstalledFiles
26
+ /pkg/
27
+ /spec/reports/
28
+ /spec/examples.txt
29
+ /test/tmp/
30
+ /test/version_tmp/
31
+ /tmp/
32
+
33
+ # Used by dotenv library to load environment variables.
34
+ # .env
35
+
36
+ # Ignore Byebug command history file.
37
+ .byebug_history
38
+
39
+ ## Specific to RubyMotion:
40
+ .dat*
41
+ .repl_history
42
+ build/
43
+ *.bridgesupport
44
+ build-iPhoneOS/
45
+ build-iPhoneSimulator/
46
+
47
+ ## Specific to RubyMotion (use of CocoaPods):
48
+ #
49
+ # We recommend against adding the Pods directory to your .gitignore. However
50
+ # you should judge for yourself, the pros and cons are mentioned at:
51
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
52
+ # vendor/Pods/
53
+
54
+ ## Documentation cache and generated files:
55
+ /.yardoc/
56
+ /_yardoc/
57
+ /doc/
58
+ /rdoc/
59
+
60
+ ## Environment normalization:
61
+ /.bundle/
62
+ /vendor/bundle
63
+ /lib/bundler/man/
64
+
65
+ # for a library or gem, you might want to ignore these files since the code is
66
+ # intended to run in multiple environments; otherwise, check them in:
67
+ Gemfile.lock
68
+ .ruby-version
69
+ .ruby-gemset
70
+
71
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
72
+ .rvmrc
73
+
74
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
75
+ # .rubocop-https?--*
76
+
77
+ ### RubyMine+all ###
78
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
79
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
80
+
81
+ # User-specific stuff
82
+ .idea/**/workspace.xml
83
+ .idea/**/tasks.xml
84
+ .idea/**/usage.statistics.xml
85
+ .idea/**/dictionaries
86
+ .idea/**/shelf
87
+
88
+ # AWS User-specific
89
+ .idea/**/aws.xml
90
+
91
+ # Generated files
92
+ .idea/**/contentModel.xml
93
+
94
+ # Sensitive or high-churn files
95
+ .idea/**/dataSources/
96
+ .idea/**/dataSources.ids
97
+ .idea/**/dataSources.local.xml
98
+ .idea/**/sqlDataSources.xml
99
+ .idea/**/dynamic.xml
100
+ .idea/**/uiDesigner.xml
101
+ .idea/**/dbnavigator.xml
102
+
103
+ # Gradle
104
+ .idea/**/gradle.xml
105
+ .idea/**/libraries
106
+
107
+ # Gradle and Maven with auto-import
108
+ # When using Gradle or Maven with auto-import, you should exclude module files,
109
+ # since they will be recreated, and may cause churn. Uncomment if using
110
+ # auto-import.
111
+ # .idea/artifacts
112
+ # .idea/compiler.xml
113
+ # .idea/jarRepositories.xml
114
+ # .idea/modules.xml
115
+ # .idea/*.iml
116
+ # .idea/modules
117
+ # *.iml
118
+ # *.ipr
119
+
120
+ # CMake
121
+ cmake-build-*/
122
+
123
+ # Mongo Explorer plugin
124
+ .idea/**/mongoSettings.xml
125
+
126
+ # File-based project format
127
+ *.iws
128
+
129
+ # IntelliJ
130
+ out/
131
+
132
+ # mpeltonen/sbt-idea plugin
133
+ .idea_modules/
134
+
135
+ # JIRA plugin
136
+ atlassian-ide-plugin.xml
137
+
138
+ # Cursive Clojure plugin
139
+ .idea/replstate.xml
140
+
141
+ # SonarLint plugin
142
+ .idea/sonarlint/
143
+
144
+ # Crashlytics plugin (for Android Studio and IntelliJ)
145
+ com_crashlytics_export_strings.xml
146
+ crashlytics.properties
147
+ crashlytics-build.properties
148
+ fabric.properties
149
+
150
+ # Editor-based Rest Client
151
+ .idea/httpRequests
152
+
153
+ # Android studio 3.1+ serialized cache file
154
+ .idea/caches/build_file_checksums.ser
155
+
156
+ ### RubyMine+all Patch ###
157
+ # Ignore everything but code style settings and run configurations
158
+ # that are supposed to be shared within teams.
159
+
160
+ .idea/*
161
+
162
+ !.idea/codeStyles
163
+ !.idea/runConfigurations
164
+
165
+ # End of https://www.toptal.com/developers/gitignore/api/ruby,rubymine+all,linux
data/.rspec ADDED
@@ -0,0 +1,5 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
4
+ --tag ~planned
5
+ --tag ~priority:low
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in maimai-net.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,32 @@
1
+ The Clear BSD License
2
+
3
+ Copyright (c) 2025 Rei Hakurei
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted (subject to the limitations in the disclaimer
8
+ below) provided that the following conditions are met:
9
+
10
+ * Redistributions of source code must retain the above copyright notice,
11
+ this list of conditions and the following disclaimer.
12
+
13
+ * Redistributions in binary form must reproduce the above copyright
14
+ notice, this list of conditions and the following disclaimer in the
15
+ documentation and/or other materials provided with the distribution.
16
+
17
+ * Neither the name of the copyright holder nor the names of its
18
+ contributors may be used to endorse or promote products derived from this
19
+ software without specific prior written permission.
20
+
21
+ NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
22
+ THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
26
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
29
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # MaimaiNet
2
+
3
+ Unofficial API for maimaiDXNET. This library simplifies several aspects that can be
4
+ loaded through maimaiDX website with couple of hassles.
5
+
6
+ This libary mostly being worked on as a core for my personal archiver.
7
+ Any feedback and suggestion regarding this library are welcomed.
8
+
9
+ ## FAQ
10
+
11
+ - **Will you implement song blacklisting?**
12
+ Until I can figure out how those hashed IDs work, no.
13
+ - **Does this support Japan region?**
14
+ Untested for now, I need to prepare the whole flow for both Japan and Asia version.
15
+ - **Is there any online non-Japan and Asia region?**
16
+ Check it by your own, at least the SilentBlue web. If the US region is combined with Asia, there you go, use the Asia endpoint in the end.
17
+ - **Any plan to support Ruby 2.6?** I wish.
18
+ - **Any plan to support Ruby 3.0+?** I can attempt to backport them, the same consideration as if I do Ruby 2.6 support instead.
19
+
20
+ ## Installation
21
+
22
+ Add this line to your application's Gemfile:
23
+
24
+ ```ruby
25
+ gem 'maimai_net'
26
+ ```
27
+
28
+ And then execute:
29
+
30
+ $ bundle install
31
+
32
+ Or install it yourself as:
33
+
34
+ $ gem install maimainet
35
+
36
+ ## Usage
37
+
38
+ ```ruby
39
+ require 'maimai_net'
40
+ client = MaimaiNet::Client.asia.new(username, password)
41
+ ```
42
+
43
+ ## Development
44
+
45
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
46
+
47
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ begin; require 'byebug'; rescue LoadError; end
5
+ require "maimai_net"
6
+
7
+ console = nil
8
+ begin; require 'pry'
9
+ rescue LoadError; require 'irb'; console = :irb
10
+ else; console = :pry
11
+ end
12
+
13
+ case console
14
+ when :pry; Pry.start
15
+ else; IRB.start(__FILE__)
16
+ end
data/bin/setup ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install