<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Corbel;
        panose-1:2 11 5 3 2 2 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Georgia","serif";
        color:#0F243E;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-AU link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'>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:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>mysql> select max(eprintid) from eprint \G<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>max(eprintid): 103687<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>mysql> select count(*) from eprint \G<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>count(*): 85718<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>mysql> select count(*) from eprint where eprint_status='archive' \G<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>count(*): 74113<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>mysql> select count(*) from eprint where eprint_status='archive' or eprint_status='buffer' \G<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>count(*): 74224<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>mysql> -- some manual sleuthing went into these parameters:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>mysql> select max(eprintid) from eprint where date_year = 2017 and date_month = 12 and eprint_status = 'archive' \G;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:#0F243E'>max(eprintid): 102775<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'>And that’s without looking at ‘succeeds’ (or replacedby) relationships, etc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'>So as you can imagine, in our horrible frankensteiny repository, tracking the 100,000<sup>th</sup> 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:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Georgia","serif";color:#0F243E'>“QUT ePrints hosts 74,000 research works with 97,000 downloads in the past week.”<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'>I’m happy to share that script, if anyone else is interested.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'>Cheers<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:6.0pt;font-family:"Courier New";color:#003366'>-- <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:gray'><a href="http://staff.qut.edu.au/details?id=kerwinm"><span style='color:gray;text-decoration:none'>Matthew</span><span style='color:gray;font-weight:normal;text-decoration:none'> </span><span style='color:gray;text-decoration:none'>Kerwin</span></a></span></b><b><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#7A7A7A'> </span></b><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#7A7A7A'>| ITS-EIS:AS:LS | </span><u><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#7F7F7F'><a href="https://map.what3words.com/cards.reader.steer"><span style='color:#7F7F7F'>KG-SYN</span></a></span></u><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#7A7A7A'> | QUT</span><span style='font-size:7.5pt;font-family:"Verdana","sans-serif";color:#7A7A7A'><o:p></o:p></span></p></div><p class=MsoNormal><span style='font-family:"Georgia","serif";color:#0F243E'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] <b>On Behalf Of </b>Adam Field<br><b>Sent:</b> Thursday, 16 February 2017 19:52<br><b>To:</b> eprints-tech@ecs.soton.ac.uk<br><b>Subject:</b> Re: [EP-tech] Figuring out the highest EPrint ID?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>I actually just created this for a tweepository last night:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><a href="http://websci-tweets.ecs.soton.ac.uk/cgi/tweepository/highest_tweetid">http://websci-tweets.ecs.soton.ac.uk/cgi/tweepository/highest_tweetid</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Here’s what’s in the cgi scrtipt directory (you’ll just need to globally replace ‘tweet’ with ‘eprint’ in the mysql query):<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>use EPrints;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>use strict;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>my $eprints = EPrints->new;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>my $repo = $eprints->current_repository;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>exit( 0 ) unless( defined $repo );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>my $format = $repo->param( "format" );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>$format = "default" if( !defined $format );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>my $sql = 'SELECT MAX(tweetid) FROM tweet';<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>my $sth = $repo->database->prepare($sql);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>$sth->execute;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>my $high_id = $sth->fetchrow_arrayref->[0];<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>if ($format eq 'commas')<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> print scalar reverse join ',', unpack '(A3)*', reverse $high_id;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>else<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> print $high_id;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-family:"Times New Roman","serif";color:black'> </span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Times New Roman","serif";color:black'> </span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Times New Roman","serif";color:black'> </span><span lang=EN-US><o:p></o:p></span></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='border:none;border-top:solid #2C3841 1.0pt;padding:0cm 0cm 3.0pt 0cm'><p class=MsoNormal><a href="http://www.jisc.ac.uk/"><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:blue;text-decoration:none'><img border=0 width=60 height=35 id="_x0000_i1025" src="cid:image001.png@01D288FF.4CFE54E0" alt=isc></span></a><o:p></o:p></p></td></tr><tr><td valign=top style='padding:7.5pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:12.0pt;font-family:"Corbel","sans-serif";color:#2C3841'>Adam Field</span></b><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><span style='font-size:12.0pt;font-family:"Corbel","sans-serif";color:#2C3841'>SHERPA services analyst developer</span><o:p></o:p></p></td></tr></table></div><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin-left:36.0pt'><b><span lang=EN-US style='color:black'>From: </span></b><span lang=EN-US style='color:black'><<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>> on behalf of John Salter <<a href="mailto:J.Salter@leeds.ac.uk">J.Salter@leeds.ac.uk</a>><br><b>Reply-To: </b>"<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>" <<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>><br><b>Date: </b>Wednesday, 15 February 2017 11:58<br><b>To: </b>"<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>" <<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>><br><b>Subject: </b>Re: [EP-tech] Figuring out the highest EPrint ID?</span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='font-family:"Times New Roman","serif"'> </span><span lang=EN-US><o:p></o:p></span></p></div><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'>Try the database:</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'>mysql> SELECT MAX(eprintid) FROM eprint;</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'>mysql> SELECT counter FROM counters WHERE counterid = 'eprintid';</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'>There's probably a way to get this via an EPrints session too if you need that?</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'>Cheers,</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'>John</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin-left:36.0pt'><b><span lang=EN-US style='mso-fareast-language:EN-GB'>From:</span></b><span lang=EN-US style='mso-fareast-language:EN-GB'> <a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a> [<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>] <b>On Behalf Of </b>Andrew Beeken<br><b>Sent:</b> 15 February 2017 11:46<br><b>To:</b> <a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><br><b>Subject:</b> [EP-tech] Figuring out the highest EPrint ID?</span><span lang=EN-US><o:p></o:p></span></p></div></div><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US>Hello again!<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US>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?<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US>Andrew<o:p></o:p></span></p><div><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Times New Roman","serif";mso-fareast-language:EN-GB'><br><b>The University of Lincoln, located in the heart of the city of Lincoln, has established an international reputation based on high student satisfaction, excellent graduate employment and world-class research.</b></span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Arial","sans-serif";mso-fareast-language:EN-GB'><br>The information in this e-mail and any attachments may be confidential. If you have received this email in error please notify the sender immediately and remove it from your system. Do not disclose the contents to another person or take copies.<br><br>Email is not secure and may contain viruses. The University of Lincoln makes every effort to ensure email is sent without viruses, but cannot guarantee this and recommends recipients take appropriate precautions.<br><br>The University may monitor email traffic data and content in accordance with its policies and English law. Further information can be found at: <a href="http://www.lincoln.ac.uk/legal">http://www.lincoln.ac.uk/legal</a>.</span><span lang=EN-US><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US style='font-size:7.5pt;font-family:"Corbel","sans-serif"'><br>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.<br><br>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. </span><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p></div></body></html>