EPrints Technical Mailing List Archive
Message: #06286
< 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: Matthew Kerwin <matthew.kerwin@qut.edu.au>
- Date: Thu, 16 Feb 2017 23:22:06 +0000
So, while we’re talking about highest EPrint ID and milestone publications and all that, here are some fun facts from QUT ePrints, expressed in SQL since interpretive dance doesn’t carry across very well via email: mysql> select max(eprintid) from eprint \G max(eprintid): 103687 mysql> select count(*) from eprint \G count(*): 85718 mysql> select count(*) from eprint where eprint_status='archive' \G count(*): 74113 mysql> select count(*) from eprint where eprint_status='archive' or eprint_status='buffer' \G count(*): 74224 mysql> -- some manual sleuthing went into these parameters: mysql> select max(eprintid) from eprint where date_year = 2017 and date_month = 12 and eprint_status = 'archive' \G; max(eprintid): 102775 And that’s without looking at ‘succeeds’ (or replacedby) relationships, etc. So as you can imagine, in our horrible frankensteiny repository, tracking the 100,000th eprint is a lost cause. I do have a cron script that generates a phrase we use on the front page, which makes a very broad (and approximate) summary: “QUT ePrints hosts 74,000 research works with 97,000 downloads in the past week.” I’m happy to share that script, if anyone else is interested. Cheers -- Matthew Kerwin | ITS-EIS:AS:LS | KG-SYN | QUT From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Adam Field 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
|
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
- References:
- Re: [EP-tech] Figuring out the highest EPrint ID?
- From: Adam Field <Adam.Field@jisc.ac.uk>
- Re: [EP-tech] Figuring out the highest EPrint ID?
- Prev by Date: Re: [EP-tech] Another import thing!
- Next by Date: Re: [EP-tech] Import DOI Issue
- Previous by thread: Re: [EP-tech] Figuring out the highest EPrint ID?
- Next by thread: [EP-tech] Conversion of doc to pdf
- Index(es):