DEV Community

Miguel Tomás
Miguel Tomás

Posted on

Scientific.net Number of reads WebHook

In the meantime i've coded a small webhook to retrieve the number of reads from a paper published on scientific.net and insert it to any author/ researcher webpage:

HTML frontend code:

<script src="js/jquery-3.4.1.min.js"></script>
   <small id="include-aef-stats">
         <script>
             $(function(){ $("#include-aef-stats").load("kernel/loadstats.php"); });
         </script>   
    </small>
Enter fullscreen mode Exit fullscreen mode

loadstats.php backend code:

<?php
$url = "https://www.scientific.net/Paper/GetDownloadsAndVisitorsCount?paperId=523460";
$scientificNetCounter = file_get_contents($url);

echo $scientificNetCounter." reads on A.E.F. website" 
?>
Enter fullscreen mode Exit fullscreen mode

Alt Text

Top comments (0)