Skip to content

Instantly share code, notes, and snippets.

@hyrious
Created June 1, 2025 03:29
Show Gist options
  • Select an option

  • Save hyrious/916164320872563ffc20c0be4881d493 to your computer and use it in GitHub Desktop.

Select an option

Save hyrious/916164320872563ffc20c0be4881d493 to your computer and use it in GitHub Desktop.
require "json"
require "fileutils"
require "cgi"
include FileUtils::Verbose
folder = 'C:\Users\hyrious\OneDrive\Apps\Violentmonkey' # <-- change to your backup folder place
index_file = 'Violentmonkey'
target = File.join __dir__, 'ViolentmonkeyExport'
mkdir_p target
a = JSON.load_file File.join folder, index_file
info = a['info']
info.each do |part, meta|
filename = 'vm@2-' + CGI.unescape(part)
i = meta['position']
data = JSON.load_file File.join folder, filename
File.write File.join(target, "#{i}-#{filename}.user.js"), data['code']
end
@dxzdxz1

dxzdxz1 commented Jul 1, 2025

Copy link
Copy Markdown

It worked perfectly. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment