Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
irma2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gerhard Gonter
irma2
Commits
ecf119f2
Commit
ecf119f2
authored
Oct 2, 2017
by
Gerhard Gonter
Browse files
Options
Downloads
Patches
Plain Diff
experiments with DataCite DOI
parent
2f02ab45
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dcd.pl
+2
-2
2 additions, 2 deletions
dcd.pl
mintdoi.pl
+8
-4
8 additions, 4 deletions
mintdoi.pl
with
10 additions
and
6 deletions
dcd.pl
+
2
−
2
View file @
ecf119f2
...
@@ -100,9 +100,9 @@ sub register_url
...
@@ -100,9 +100,9 @@ sub register_url
my
$repo_url
=
shift
;
my
$repo_url
=
shift
;
print
__LINE__
,
"
repo_url=[
$repo_url
]
\n
";
print
__LINE__
,
"
repo_url=[
$repo_url
]
\n
";
if
(
$repo_url
=~
m#^https://(phaidra(-(sandbox|temp))?\.univie\.ac\.at)/(o:\d+)$#
)
if
(
$repo_url
=~
m#^https
?
://(phaidra(-(sandbox|temp))?\.univie\.ac\.at)/(
detail_object/)?(
o:\d+)$#
)
{
{
my
(
$repo
,
$s1
,
$s2
,
$pid
)
=
(
$
1
,
$
2
,
$
3
,
$
4
);
my
(
$repo
,
$s1
,
$s2
,
$s3
,
$pid
)
=
(
$
1
,
$
2
,
$
3
,
$
4
,
$
5
);
usage
("
unknown repo=[
$repo
]
")
unless
(
exists
(
$cnf
->
{
repositories
}
->
{
$repo
}));
usage
("
unknown repo=[
$repo
]
")
unless
(
exists
(
$cnf
->
{
repositories
}
->
{
$repo
}));
print
__LINE__
,
"
repo=[
$repo
]
\n
";
print
__LINE__
,
"
repo=[
$repo
]
\n
";
...
...
This diff is collapsed.
Click to expand it.
mintdoi.pl
+
8
−
4
View file @
ecf119f2
...
@@ -9,20 +9,23 @@ use Encode::Base32::Crockford;
...
@@ -9,20 +9,23 @@ use Encode::Base32::Crockford;
# check(); exit;
# check(); exit;
my
$prefix
=
'
10.0174
';
my
$cnt
=
10_000_000
;
my
$cnt
=
10_000_000
;
while
(
$cnt
--
>
0
)
while
(
$cnt
--
>
0
)
{
{
my
$str
=
mk_doi
();
my
$str
=
mk_doi
();
# next unless (defined ($str));
# next unless (defined ($str));
print
$str
,
"
\n
";
# print $str, "\n";
print
join
('
/
',
$prefix
,
$str
),
"
\n
";
}
}
exit
(
0
);
exit
(
0
);
sub
mk_doi
sub
mk_doi
{
{
my
$tries
=
1
;
my
$tries
=
5
;
my
$str
;
my
$str
;
do
do
...
@@ -32,10 +35,11 @@ sub mk_doi
...
@@ -32,10 +35,11 @@ sub mk_doi
$str
=
Encode::Base32::Crockford::
base32_encode_with_checksum
(
$num
);
$str
=
Encode::Base32::Crockford::
base32_encode_with_checksum
(
$num
);
# printf ("%12d %s\n", $num, $str);
# printf ("%12d %s\n", $num, $str);
return
join
('
-
',
$tries
,
$
1
,
$
2
)
if
(
$str
=~
m#^([A-Z0-9]{4})([A-Z0-9]{4})$#
);
#
return join ('-', $tries, $1, $2) if ($str =~ m#^([A-Z0-9]{4})([A-Z0-9]{4})$#);
}
while
(
$tries
--
>
0
);
}
while
(
$tries
--
>
0
);
return
join
('
-
',
$tries
,
$
1
,
$
2
)
if
(
$str
=~
m#^(.{4})(.{4})$#
);
return
join
('
-
',
$
1
,
$
2
)
if
(
$str
=~
m#^([A-Z0-9]{4})([A-Z0-9]{4})$#
);
# return join ('-', $tries, $1, $2) if ($str =~ m#^(.{4})(.{4})$#);
return
(
$str
);
return
(
$str
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment