EPrints Technical Mailing List Archive
Message: #09153
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] ChatGPT
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] ChatGPT
- From: Christopher Gutteridge <totl@soton.ac.uk>
- Date: Sun, 8 Jan 2023 18:25:37 +0000
So, it seems that EPrints is well documented enough online that
ChatGPT can write simple EPrints scripts and functions. I'm
frankly astounded at what this tool can do. It can't do complex
stuff but it's still impressive.
#!/usr/bin/perl
use EPrints;
Initialize the repository
my $repo = EPrints->new->repository('your_repository_id');
Find all records with no title
my $records = $repo->search({ match => 'AND', filters => [ { meta_fields => [ 'title' ], value => '', match => 'EQ' }, ], });
Set the title of each record to "NO TITLE"
foreach my $record ($records->get_records) {
$record->set_value('title', 'NO TITLE');
$record->commit;
}
print "Finished setting titles of records with no title to 'NO TITLE'\n";
-- Christopher Gutteridge, Research Application Support, University of Southampton
- Follow-Ups:
- [EP-tech] ChatGPT
- From: Christopher Gutteridge <totl@soton.ac.uk>
- [EP-tech] ChatGPT
- References:
- [EP-tech] ChatGPT
- From: Christopher Gutteridge <totl@soton.ac.uk>
- [EP-tech] ChatGPT
- Prev by Date: Re: [EP-tech] Change from eprints core to pub
- Next by Date: Re: [EP-tech] ChatGPT
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):