DEV Community

Miguel Tomás
Miguel Tomás

Posted on

2 2

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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more