<commit_before>#!/usr/bin/env tclsh8.5
#
# same as song_submit.py essentially
#

package require http

set url http://leviathan.summercat.com/~a/music/api.php
set username "cd"
set password "password"

if {$argc != 4} {
	puts "Usage: $argv0 <artist> <album> <song> <length>"
	return
}

puts "song_submit.tcl got: artist: [lindex $argv 0] album: [lindex $argv 1] title: [lindex $argv 1] length: [lindex $argv 3]"
set query [http::formatQuery artist [lindex $argv 0] album [lindex $argv 1] title [lindex $argv 2] length [lindex $argv 3] user $username pass $password]
set t [http::geturl $url -query $query -binary 1]
puts [http::data $t]
puts "converted: [encoding convertfrom utf-8 [http::data $t]] (end of converted)"
puts $query
http::cleanup $t<commit_msg>clean up song_submit.tcl a bit<commit_after>#!/usr/bin/env tclsh8.5
#
# same as song_submit.py essentially
#

package require http

set url http://leviathan.summercat.com/~a/music/api.php
set username "cd"
set password "password"
set debug 1

if {$argc != 4} {
	puts "Got $argc arguments: $argv"
	puts "Usage: $argv0 <artist> <album> <song> <length>"
	return
}

set query [http::formatQuery artist [lindex $argv 0] album [lindex $argv 1] title [lindex $argv 2] length [lindex $argv 3] user $username pass $password]
set t [http::geturl $url -query $query -binary 1]
if {$debug == 1} {
	puts "song_submit.tcl: artist: [lindex $argv 0] album: [lindex $argv 1] title: [lindex $argv 2] length: [lindex $argv 3]"
	puts "Response: ([http::data $t])"
	puts "Converted response: ([encoding convertfrom utf-8 [http::data $t]])"
	puts "${query}\n"
}
http::cleanup $t
{'fraction_non_alphanumeric': 0.15541795665634675, 'fraction_numerical': 0.018575851393188854, 'mean_word_length': 4.9411764705882355, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2724014', 'n_tokens_mistral': 627, 'n_tokens_neox': 591, 'n_words': 204}