fix workshop job item parser
This commit is contained in:
parent
ee70e6248d
commit
ce75f055fe
1 changed files with 17 additions and 5 deletions
|
|
@ -34,14 +34,26 @@ json_value() {
|
|||
}
|
||||
|
||||
json_items() {
|
||||
perl -0777 -ne '
|
||||
if (/"items"\s*:\s*\[(.*?)\]/s) {
|
||||
MANIFEST_FILE="$MANIFEST" perl -0777 -e '
|
||||
my $f = $ENV{"MANIFEST_FILE"};
|
||||
open my $fh, "<", $f or exit 1;
|
||||
local $/;
|
||||
my $json = <$fh>;
|
||||
|
||||
my %seen;
|
||||
|
||||
if ($json =~ /"items"\s*:\s*\[(.*?)\]/s) {
|
||||
my $x = $1;
|
||||
while ($x =~ /"([0-9]{3,20})"/g) { print "$1\n"; }
|
||||
while ($x =~ /(?<![0-9])([0-9]{3,20})(?![0-9])/g) { print "$1\n"; }
|
||||
while ($x =~ /"([0-9]{3,20})"/g) {
|
||||
print "$1\n" unless $seen{$1}++;
|
||||
}
|
||||
while ($x =~ /(?<![0-9])([0-9]{3,20})(?![0-9])/g) {
|
||||
print "$1\n" unless $seen{$1}++;
|
||||
}
|
||||
}
|
||||
' "$MANIFEST" | awk '!seen[$0]++'
|
||||
'
|
||||
}
|
||||
|
||||
ACTION="$(json_value action)"
|
||||
APPID="$(json_value workshop_app_id)"
|
||||
STEAM_APPID="$(json_value steam_app_id)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue