EPrints Technical Mailing List Archive
Message: #06282
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Figuring out the highest EPrint ID?
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Figuring out the highest EPrint ID?
- From: Adam Field <Adam.Field@jisc.ac.uk>
- Date: Thu, 16 Feb 2017 09:51:51 +0000
I actually just created this for a tweepository last night: http://websci-tweets.ecs.soton.ac.uk/cgi/tweepository/highest_tweetid Here’s what’s in the cgi scrtipt directory (you’ll just need to globally replace ‘tweet’ with ‘eprint’ in the mysql query): use EPrints; use strict; my $eprints = EPrints->new; my $repo = $eprints->current_repository; exit( 0 ) unless( defined $repo ); my $format = $repo->param( "format" ); $format = "default" if( !defined $format ); my $sql = 'SELECT MAX(tweetid) FROM tweet'; my $sth = $repo->database->prepare($sql); $sth->execute; my $high_id = $sth->fetchrow_arrayref->[0]; if ($format eq 'commas') { print scalar reverse join ',', unpack '(A3)*', reverse $high_id; } else { print $high_id; } From:
<eprints-tech-bounces@ecs.soton.ac.uk> on behalf of John Salter <J.Salter@leeds.ac.uk> Try the database: mysql> SELECT MAX(eprintid) FROM eprint; mysql> SELECT counter FROM counters WHERE counterid = 'eprintid'; There's probably a way to get this via an EPrints session too if you need that? Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Andrew Beeken Hello again! New one here, related to a different project! So, I’m trying to find the HIGHEST EPrint ID that we have in our live system. I was doing this by taking the “Latest Additions” atom feed and looking at the topmost
entry, however I have now realised this isn’t accurate as this could be representative of an item that has been sat in a work area for a number of weeks or even months. Is there an easy way, via endpoint or API access, that I could use to derive the highest
number? Andrew
Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800. Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800. |
- Prev by Date: [EP-tech] Antwort: Re: Figuring out the highest EPrint ID?
- Next by Date: Re: [EP-tech] Export Plugin: Simple Metadata - What is it good for?
- Previous by thread: [EP-tech] Antwort: Re: Figuring out the highest EPrint ID?
- Next by thread: Re: [EP-tech] Figuring out the highest EPrint ID?
- Index(es):